简体   繁体   English

Ubuntu,致命错误:Python.h: No such file or directory #include<Python.h>

[英]Ubuntu, fatal error: Python.h: No such file or directory #include <Python.h>

when i try to install psycopg2 the error appears当我尝试安装 psycopg2 时出现错误

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

because, there is a search for this file along the path /usr/include/python3.8因为,沿着路径 /usr/include/python3.8 搜索了这个文件

but this file is located in the path /usr/local/include/python3.8/Python.x但此文件位于路径 /usr/local/include/python3.8/Python.x

How to solve this problem??如何解决这个问题呢?? Is Python installed in the wrong directory? Python 是否安装在错误的目录中?

Its not clear what version of Ubuntu you are using.不清楚您使用的是哪个版本的 Ubuntu。 Assuming it is a fresh install and you don't have these installed.假设它是全新安装并且您没有安装这些。 I would suggest you install the following我建议你安装以下

sudo apt-get install python3 python-dev python3-dev build-essential

Once these are installed then try again installing psycopg2安装这些后,再尝试安装psycopg2

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

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