ImportError: No module named PyQt5 - OSX Mavericks
macos, pyqt5, python, python-2.7
Solution
Okay, I hammered at this until I finally found a solution. It seems like this might be a bug in the PyQt library installation or somewhere else. I created a $PYTHONPATH environment variable to point to the newly installed PyQt .py files that hold references to the all of the Qt bindings.
export set PYTHONPATH=$PYTHONPATH:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
After that, everything worked like magic. This includes PyCharm after going to Settings->Project Interpreter->Python Interpreters->Paths (tab), and clicking the "Reload list of paths" button with the blue circular arrows on the bottom.
Problem
I'm trying to get PyQt5 running on OSX. I downloaded and installed the Qt5 binaries. Then, I downloaded the latest SIP source, compiled and installed it. Finally, I downloaded the latest version of PyQt, compiled, and installed it. ``` python configure.py --qmake /Users/jsmaupin/Qt/5.1.1/clang_64/bin/qmake --sip /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip ``` I'm trying to get this to run on the default Python 2.7 installation. It looks like the files were installed into the correct location (as far as I can tell) at /System/Library/Frameworks/Python.framework/Versions/2.7/share/sip/PyQt5/ However, whenever I try to import anything from PyQt5 python reports that it cannot find PyQt5 The code: ``` from PyQt5 import QtCore ``` The result: ``` from PyQt5 import QtCore ImportError: No module named PyQt5 ``` I'm a Python newbie, so help is greatly appreciated!