gpt4 book ai didi

python - 编译 PyQt5 时出现 fatal error : Python. h 不存在

转载 作者:太空狗 更新时间:2023-10-29 21:12:33 25 4
gpt4 key购买 nike

我正在尝试在我的 Ubuntu 12.04 机器上安装 PyQt5。所以从 here 下载后我解压了它,运行了 python configure.pymake。然而,结果如下:

cd qpy/ && ( test -f Makefile || /opt/qt5/bin/qmake /home/kram/Downloads/PyQt-gpl-5.0/qpy/qpy.pro -o Makefile ) && make -f Makefile 
make[1]: Map '/home/kram/Downloads/PyQt-gpl-5.0/qpy' is entered
cd QtCore/ && ( test -f Makefile || /opt/qt5/bin/qmake /home/kram/Downloads/PyQt-gpl-5.0/qpy/QtCore/QtCore.pro -o Makefile ) && make -f Makefile
make[2]: Map '/home/kram/Downloads/PyQt-gpl-5.0/qpy/QtCore' is entered
g++ -c -pipe -fno-strict-aliasing -O2 -Wall -W -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/opt/qt5/mkspecs/linux-g++ -I. -I. -I../../QtCore -I/usr/local/include/python2.7 -I/opt/qt5/include -I/opt/qt5/include/QtCore -I. -o qpycore_chimera.o qpycore_chimera.cpp
qpycore_chimera.cpp:21:20: fatal error: Python.h: File or folder does not exist
compilation terminated.
make[2]: *** [qpycore_chimera.o] Error 1
make[2]: Map '/home/kram/Downloads/PyQt-gpl-5.0/qpy/QtCore' is left
make[1]: *** [sub-QtCore-make_first] Error 2
make[1]: Map '/home/kram/Downloads/PyQt-gpl-5.0/qpy' is left
make: *** [sub-qpy-make_first-ordered] Error 2

(我将错误消息的某些部分从荷兰语翻译成英语,所以有些词可能与正常措辞有点偏差..)

有人知道这是什么问题吗?相关的 Python.h 文件在哪里?

最佳答案

问题是每个 Makefile 中所有 python header 的包含路径都将指向 /usr/local/include/python2.7 ,它应该是 /usr/include/python2.7

对此有 2 种可能的解决方案。您可以更改每个 Makefile 中出现的所有此内容,或者您​​可以创建指向该位置的符号链接(symbolic link)

sudo ln -s /usr/include/python2.7 /usr/local/include/python2.7

现在你可以运行make

关于python - 编译 PyQt5 时出现 fatal error : Python. h 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17698877/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com