Building PythonQT on macOS?
-
Hi,
I've been trying to embed Python in a Qt/C++ application using PythonQt. For context I'm running Catalina 10.15.7 with Qt version 5.15.2. Trying to build PythonQt as per these instructions with qmake gives a linker error about the python installation:ld: can't map file, errno=22 file '/usr/local/Cellar/python@3.9/3.9.6/Frameworks' for architecture x86_64
I imagine this has to do with either the actual python installation from Homebrew or the paths given in the 'python.prf' file, which right now are set like so:
macx { # for macx you need to have the Python development kit installed as framework INCLUDEPATH += /usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Headers LIBS += /usr/local/Cellar/python@3.9/3.9.6/Frameworks -framework Python }
Much appreciated if anyone knows what I'm doing wrong here with the include paths or the python installation, thanks.
-
Hi and welcome to devnet,
You forgot the -F before the path your custom Python framework.
-
Oh thank you- it's not complaining about the framework path anymore and qmake finishes successfully but trying to actually run any of the example projects gives me this:
:-1: error: No rule to make target `/Qt/5.15.2/clang_64/lib/libQt5UiTools_debug.a', needed by `../../lib/libPythonQt_QtAll-Qt5-Python3.9_d.3.2.0.dylib'. Stop.
Is this some kind of an incompatibility issue with one of Qt's libs?
-
Looks like a build error, no ?
Are you using a pre-built version of Qt ?