[PyQt] Problems with configuring compiling & installing pyqt5 on mac

Phil Thompson phil at riverbankcomputing.com
Tue Jan 28 22:24:10 GMT 2014


On 28-01-2014 9:36 pm, Kenneth Miller wrote:
> I'm on mac (Mountain Lion), and I get python import errors after 
> going
> through all the trouble of trying to configure compile and install
> pyqt5. I need someone to help me get through this phase of
> troubleshooting to where I can just use pyqt, because right now I'm
> stuck terribly. Someone please help.
>
> Here are as many details about my setup and the process that I go
> through in order to reproduce the problem.
>
> I have python3.2 installed in /opt/local/bin/python3.2, which is a 
> sym
> link to
> 
> /opt/local/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2
>
> I installed qt versions 5.2.0 and 5.0.2 into /Applications/Qt/5.2.0
> and /Applications/Qt/5.0.2 respectively.
>
> I download sip:
> 
> http://sourceforge.net/projects/pyqt/files/sip/sip-4.15.4/sip-4.15.4.tar.gz
> Run the following commands:
>
> cd ~/Downloads/sip-4.15.4
> sudo python3.2 configure.py
>
> And I get this information back:
> The SIP code generator will be installed in
> /opt/local/Library/Frameworks/Python.framework/Versions/3.2/bin.
> The sip module will be installed in
> 
> /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages.
> The sip.h header file will be installed in
> 
> /opt/local/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m.
> The default directory to install .sip files in is
> 
> /opt/local/Library/Frameworks/Python.framework/Versions/3.2/share/sip.
>
> make -j9
> sudo make install
>
> I download PyQt5:
> 
> http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.2/PyQt-gpl-5.2.tar.gz
> run the following commands:
> cd ~/Downloads/PyQt-gpl-5.2.tar.gz
> sudo python3.2 configure.py --qmake
> /Applications/Qt/5.2.0/clang_64/bin/qmake --sip
> ~/Downloads/sip-4.15.4/sipgen/sip
>
> sudo make -j9 install
>
> I follow the first line from this tutorial:
> http://pyqt.sourceforge.net/Docs/PyQt5/python_shell.html
>
>>>> from PyQt5.QtWidgets import QApplication
>
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> ImportError:
> 
> dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/PyQt5/QtGui.so,
> 2): Symbol not found: __Z20qpyopengl_from_GLintPiPKil
>  Referenced from:
> 
> /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/PyQt5/QtGui.so
>  Expected in: flat namespace
>  in
> 
> /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/PyQt5/QtGui.so
>
>
> Why do I get this error? How do I fix it?

I would guess that something is getting confused with having the two 
versions of Qt installed. Why do you need Qt v5.0.2? The symbol is 
defined and used in QtGui.so, but only for Qt versions >= 5.1.0.

Phil


More information about the PyQt mailing list