致命錯誤:Python.h:沒有這樣的文件或目錄我試圖使用一個C擴展名文件構建一個共享庫,但首先我必須使用以下命令生成輸出文件:gcc -Wall utilsmodule.c -o Utilc執行該命令后,將收到以下錯誤消息:c:1:20:致命錯誤:Python.h:沒有終止這樣的文件或目錄編譯。事實上,我已經在互聯網上嘗試過所有建議的解決方案,但問題仍然存在.我也不介意Python.h..我設法在我的機器上找到了文件.。以前有沒有人遇到過同樣的問題?
3 回答

哆啦的時光機
TA貢獻1779條經驗 獲得超6個贊
apt
(烏本圖Debian.。):
sudo apt-get install python-dev # for python2.x installssudo apt-get install python3-dev # for python3.x installs
yum
(CentOS,RHEL.。):
sudo yum install python-devel # for python2.x installssudo yum install python34-devel # for python3.4 installs
dnf
(軟呢帽.。):
sudo dnf install python2-devel # for python2.x installssudo dnf install python3-devel # for python3.x installs
zypper
(開誠布公.。):
sudo zypper in python-devel # for python2.x installssudo zypper in python3-devel # for python3.x installs
apk
(阿爾卑斯山.。):
# This is a departure from the normal Alpine naming# scheme, which uses py2- and py3- prefixessudo apk add python2-dev # for python2.x installssudo apk add python3-dev # for python3.x installs
apt-cyg
(西格溫.。):
apt-cyg install python-devel # for python2.x installsapt-cyg install python3-devel # for python3.x installs

蝴蝶刀刀
TA貢獻1801條經驗 獲得超8個贊
sudo apt-get install python3-dev
sudo apt-get install python3.5-dev
添加回答
舉報
0/150
提交
取消