linux - 在 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
但这也给出了同样的错误。已查看相关主题的解决方案,
但没有运气。任何帮助,将不胜感激。
解决方案
所以..最后这就是让它工作的原因......必须安装python3.9-dev。
推荐阅读
- android - Xamarin Launcher.OpenAsync“请求 url 太长”
- flutter - 参数类型'列表
>' 不能分配给参数类型 'List ' - arraylist - 如何从 Apache camel 消息正文中的地图列表中访问值
- c - 我可以更改 /proc/pid/exe 以反映不同的二进制文件吗?
- javascript - 在 Safari、iOS 上使用浏览器后退按钮后,警报、确认和提示不起作用
- node.js - BotFramework中的onMembersAdded、onMembersAddedActivity、onTeamsMembersAdded有什么区别?
- sql - 如何最大化一列而不是最大另一列以避免重复组合SQL
- vb.net - 如何在 vb .NET 中向列表视图添加两次之间的持续时间
- python - OSX 代理设置被完全忽略
- java - 如何计算 batch_step_execution 元数据表中的 Spring Batch 提交计数