【问题标题】:Error installing pandas_profiling with Pip on Ubuntu 20.04在 Ubuntu 20.04 上使用 Pip 安装 pandas_profiling 时出错
【发布时间】:2024-11-30 11:40:01
【问题描述】:

pip install pandas_profiling

失败

为瓶颈运行 setup.py install ... 错误 错误:命令出错,退出状态为 1: 命令:/home/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"'; 文件='"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'" ', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'" '"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close(); exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pgrmqqqd/install-record.txt --single -version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/Bottleneck cwd:/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/ 完整输出(15 行): 运行安装 运行构建 运行 build_py 运行 build_ext 构建“bottleneck.reduce”扩展 创建 build/temp.linux-x86_64-3.9 创建 build/temp.linux-x86_64-3.9/bottleneck 创建 build/temp.linux-x86_64-3.9/bottleneck/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv - O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/me/venv/lib/python3.9/site-packages/numpy/core/包括 -I/home/me/venv/include -I/usr/include/python3.9 -c 瓶颈/src/reduce.c -o build/temp.linux-x86_64-3.9/bottleneck/src/reduce.o -氧气 在bottleneck/src/reduce.c:1 包含的文件中: 瓶颈/src/bottleneck.h:4:10:致命错误:Python.h:没有这样的文件或目录 4 | #include | ^~~~~~~~~~ 编译终止。 错误:命令“/usr/bin/x86_64-linux-gnu-gcc”失败,退出代码为 1 -------------------------------------- 错误:命令出错,退出状态为 1:/home/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"'; 文件='"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'" ', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'" '"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close(); exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pgrmqqqd/install-record.txt --single -version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/Bottleneck 检查日志以获取完整的命令输出。

我在 Ubuntu 20.04 上,我的 python 版本是-

Python 3.9.0+

我尝试单独安装瓶颈,

pip install Bottleneck --no-cache-dir

但这也给出了同样的错误。已查看相关主题的解决方案,

fatal error: Python.h: No such file or directory

setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Failed building wheel for bottleneck error

但没有运气。任何帮助将不胜感激。

【问题讨论】:

  • »»致命错误:Python.h:没有这样的文件或目录 4 | #include | «« : sudo apt install python3-dev python3-pip ..... 安装命令是:'$ pip3 install pandas_profiling'
  • 感谢@KnudLarsen;但不幸的是,这并没有帮助..我已经在 python3-9 上使用 pip3

标签: linux ubuntu python-3.9 pandas-profiling bottleneck


【解决方案1】:

所以..最后这就是让它工作的原因...必须安装 python3.9-dev。

【讨论】:

    最近更新 更多