python - Ubuntu, fatal error : Python. h : No such file or directory #include <Python. h>

标签 python ubuntu

当我尝试安装 psycopg2 时出现错误
fatal error :Python.h:没有这样的文件或目录
#include
因为,沿着路径/usr/include/python3.8 搜索这个文件
但此文件位于路径/usr/local/include/python3.8/Python.x
如何解决这个问题呢?? Python 是否安装在错误的目录中?

最佳答案

目前尚不清楚您使用的是哪个版本的 Ubuntu。假设它是全新安装并且您没有安装这些。我建议你安装以下sudo apt-get install python3 python-dev python3-dev build-essential安装这些后,再次尝试安装 psycopg2

关于python - Ubuntu, fatal error : Python. h : No such file or directory #include <Python. h>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64830200/

相关文章:

使用traceback.print_exc()打印AttributeError的回溯时出现Python TypeError

python - 正则表达式 - 如何选择其中包含 '-' 的单词?

linux - 在Ubuntu Linux中最大化侧屏

Ubuntu 上的 Node.js

python - Numba `nogil` +迟钝的线程后端导致无法加快速度(计算速度较慢!)

python - 将一组文本文件中的第 2 列添加到 1 个文本文件中

c++ - 写入文本文件并使用 c++ 和 gnuplot 绘图

c++ - 使用 setuid 运行 git 'post-receive' hook 失败

json - 如何使用 Jq 将 JSON 文件的对象转换为对象数组?

Python 正则表达式 - 限制结果?