致命错误: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
提交
取消