首页 > 解决方案 > 在 Ubuntu 20.04 上使用 Pip 安装 pandas_profiling 时出错

问题描述

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'"'"'; file ='"'"'/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'"'"', '9/瓶颈/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/include -I/home/me/venv/include -I/usr/include/python3.9 -cbottleneck/src/reduce.c -o build/temp.linux-x86_64-3.9/bottleneck/src /reduce.o -O2 在瓶颈/src/reduce.c:1 中包含的文件中:bottleneck/src/bottleneck.h:4:10:致命错误:Python.h:没有这样的文件或目录 4 | #include <Python.h> | ^~~~~~~~~~ 编译终止。错误:命令 '/usr/bin/x86_64-linux-gnu-gcc' 失败,退出代码 1 ---------------------------- ------------ 错误:命令出错,退出状态为 1:/home/me/venv/bin/python -u -c '导入 io、os、sys、setuptools、tokenize;sys.argv[0] = '"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"';file ='"'"'/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'"'"')) ' 安装 --record /tmp/pip-record-pgrmqqqd/install-record.txt --single-version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/瓶颈 检查日志以获取完整的命令输出。

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

Python 3.9.0+

我尝试单独安装瓶颈,

pip install 瓶颈 --no-cache-dir

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

致命错误:Python.h:没有这样的文件或目录

安装脚本退出并出现错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

瓶颈错误的造轮失败

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

标签: linuxubuntupython-3.9pandas-profilingbottleneck

解决方案


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


推荐阅读