亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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

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

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

3 回答

?
哆啦的時光機

TA貢獻1779條經驗 獲得超6個贊

看起來您還沒有正確安裝pythondev的頭文件和靜態庫。使用您的包管理器在系統范圍內安裝它們。

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


查看完整回答
反對 回復 2019-06-20
?
蝴蝶刀刀

TA貢獻1801條經驗 獲得超8個贊

在Ubuntu上,我運行Python 3,必須安裝

sudo apt-get install python3-dev

如果要使用未鏈接到python 3的Python版本,請安裝相關的python3.x-dev包。例如:

sudo apt-get install python3.5-dev


查看完整回答
反對 回復 2019-06-20
  • 3 回答
  • 0 關注
  • 3730 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號