简体   繁体   English

在 Ubuntu 20.04 上使用 Pip 安装 pandas_profiling 时出错

[英]Error installing pandas_profiling with Pip on Ubuntu 20.04

pip install pandas_profiling pip 安装 pandas_profiling

fails at失败于

Running setup.py install for Bottleneck... error ERROR: Command errored out with exit status 1: command: /home/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize;运行 setup.py install for Bottleneck... 错误 ERROR: Command errored out with exit status 1: command: /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'"'"'; 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'"'"'))' 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/ Complete output (15 lines): running install running build running build_py running build_ext building 'bottleneck.reduce' extension creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/bottleneck creating build/temp.linux-x86_64-3.9/bottleneck/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g 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 /瓶颈cwd:/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/完成output(15行):运行安装运行构建运行构建运行构建_运行构建_扩展创建构建439.linux-/86_6 temp.linux-x86_64-3.9/bottleneck 创建构建/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/include -I/home/me/venv/include -I/usr/include/python3.9 -c bottleneck/src/reduce.c -o build/temp.linux-x86_64-3.9/bottleneck/src/reduce.o -O2 In file included from bottleneck/src/reduce.c:1: bottleneck/src/bottleneck.h:4:10: fatal error: Python.h: No such file or directory 4 | -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 -c瓶颈/src/reduce.c -o build/temp.linux-x86_64-3.9/bottleneck/src/reduce.o -O2 在包含在bottleneck/src/reduce.c.h:1:bottleneck/botleneck.h:1:/botleneck的文件中4:10:致命错误:Python.h:没有这样的文件或目录 4 | #include <Python.h> | #include <Python.h> | ^~~~~~~~~~ compilation terminated. ^~~~~~~~~~ 编译终止。 error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /home/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize;错误:命令 '/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'"'"'; 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'"'"'))' install --record /tmp/pip-record-pgrmqqqd/install-record.txt --single-version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/Bottleneck Check the logs for full command output. 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 /瓶颈 检查日志以获取完整命令 output。

I am on Ubuntu 20.04 and my python version is-我在 Ubuntu 20.04 上,我的 python 版本是-

Python 3.9.0+ Python 3.9.0+

I tried installing Bottleneck separately,我尝试单独安装瓶颈,

pip install Bottleneck --no-cache-dir pip 安装瓶颈 --no-cache-dir

but that also gives the same error.但这也给出了同样的错误。 Have looked solutions to related topics,已查看相关主题的解决方案,

fatal error: Python.h: No such file or directory 致命错误:Python.h:没有这样的文件或目录

setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 安装脚本退出并出现错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

Failed building wheel for bottleneck error 瓶颈错误的造轮失败

but no luck.但没有运气。 Any help would be appreciated.任何帮助,将不胜感激。

So.. finally this is what made it work... had to install python3.9-dev.所以..最后这就是让它工作的原因......必须安装python3.9-dev。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM