簡體   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>

當我嘗試安裝 psycopg2 時出現錯誤

致命錯誤:Python.h:沒有這樣的文件或目錄#include <Python.h>

因為,沿着路徑 /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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM