使用 Qt creator 编译 PythonQt

compiling PythonQt with Qt creator

本文关键字:PythonQt 编译 creator Qt 使用      更新时间:2023-10-16

我正在尝试使用Qt creator编译PythonQt,但它返回了163个错误。

C:\Users\Kato\Desktop\Qt projects\PythonQt-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug\src....\PythonQt2.0.1\src\PythonQtStdDecorators.h:46: error: Python.h: 没有这样的文件或目录

等其他目录。

我安装了python 3.2,并将prf文件更改为:

# profile to include and link Python
# Change this variable to your python version (2.5, 2.6)
win32:PYTHON_VERSION=32
unix:PYTHON_VERSION=2.6
macx {
# for macx you need to have the Python development kit installed as framework
INCLUDEPATH += /System/Library/Frameworks/Python.framework/Headers
LIBS += -F/System/Library/Frameworks -framework Python
} else:win32 {
# for windows install a Python development kit or build Python yourself from the sources
# Make sure that you set the environment variable PYTHON_PATH to point to your
# python installation (or the python sources/header files when building from source).
# Make sure that you set the environment variable PYTHON_LIB to point to
# the directory where the python libs are located.
#
# When using the prebuild Python installer, this will be:
# set PYTHON_PATH = c:Python26
# set PYTHON_LIB  = c:Python26libs
PYTHON_PATH= C:Python32
PYTHON_LIB= C:Python32libs
#
# When using the python sources, this will be something like:
# set PYTHON_PATH = c:yourDirPython-2.6.1
# set PYTHON_LIB  = c:yourDirPython-2.6.1PCbuild8Win32
# check if debug or release
CONFIG(debug, debug|release) {
  DEBUG_EXT = _d 
} else {
  DEBUG_EXT = 
}
win32:INCLUDEPATH += $(PYTHON_PATH)/PC $(PYTHON_PATH)/include
win32:LIBS += $(PYTHON_LIB)/python$${PYTHON_VERSION}$${DEBUG_EXT}.lib
} else:unix {
# on linux, python-config is used to autodetect Python.
# make sure that you have installed a matching python-dev package.
unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs)
unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes)
}

根据这个构建链接,我是对的但是同样的错误!!我不知道问题出在哪里提前谢谢=(

关于构建它的页面说它还没有用 Python3 进行测试,可能需要一些更改。 这几乎可以肯定是你看到的问题。

要确定答案,请使用Python 2.6或2.7重试。 如果构建有效,那么 163 个错误可能是由于 Python2/Python3 兼容性更改造成的。

如果您必须使用Python3,那么您唯一的选择就是修复错误。 否则,只使用 Python 2.7 可能会更容易。

如果您决定修复 Python3 构建问题,如果您提交补丁会很好:-(