0

我正在尝试针对 anaconda python (2.7.x) 构建 PythonQt。运行包含的 PyGuiExample 除了系统安装之外,我无法获得任何 Python。

运行 OS X 10.10、Qt 5.5、最新的 Anaconda。

我已将 python.prf 设置为

PYTHON_CONFIG_PATH = /Users/me/anaconda/bin/python-config
QMAKE_CXXFLAGS += $$system($${PYTHON_CONFIG_PATH} --includes)
LIBS += $$system($${PYTHON_CONFIG_PATH} --libs)

设置了两个环境变量

PYTHON_PATH /Users/me/anaconda/include/python2.7
PYTHON_LIB /Users/me/anaconda/lib

构建(在 QtCreator 中)成功,并带有大量关于未使用参数的警告。

关于在系统框架以外的 Python 安装中构建 PythonQt 的任何想法?

4

1 回答 1

1

python.prf文件中,您有该macx部分。您可能更改了unix未考虑的部分。

您应该只更改以下行:

INCLUDEPATH += /usr/local/Frameworks/Python.framework/Headers
LIBS += -F/usr/local/Frameworks -framework Python

这就是我使用brewpython 版本所做的,它工作得很好。

结果我得到了lib文件夹中的所有库,这里是链接的python lib(otool -L libPythonQt.dylib):

libPythonQt.dylib:
    libPythonQt.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
    /usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.5.0, current version 5.5.1)
    /usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.5.0, current version 5.5.1)
    /usr/local/opt/qt5/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.5.0, current version 5.5.1)
    /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/gcc/lib/gcc/5/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.21.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /usr/local/lib/gcc/5/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
于 2016-01-26T11:22:36.687 回答