Liam
Liam

Reputation: 1041

How do I check that PyQt5 is installed correctly on Mac?

I've followed the instructions on:

http://danmarner.com/2014/04/23/Installing-PyQt5-with-Python-3-On-OS-X.html

to first install SIP according to the instructions found at:

http://pyqt.sourceforge.net/Docs/sip4/installation.html

and then PyQt5 by following the instructions found here:

http://pyqt.sourceforge.net/Docs/PyQt5/installation.html

and then brew install qt5

but when I run the first example PyQt-gpl-5.3.2/examples/tutorials/addressbook/part1.py it fails with the following:

Traceback (most recent call last):
  File "examples/tutorials/addressbook/part1.py", line 45, in <module>
    from PyQt5.QtCore import Qt
ImportError: No module named PyQt5.QtCore

I'm running Mavericks 10.9.5 and Python 2.7.5

It doesn't seem like it's installed correctly, or if it is python can't find it. I'm not sure how to proceed so any suggestions are much appreciated!

Upvotes: 3

Views: 9466

Answers (2)

redflasher
redflasher

Reputation: 717

if you used brew, you can add into .bashrc

export PYTHONPATH=$(brew --prefix)/lib/python3.6/site-packages:$PYTHONPATH

(edit python3.6 to your python version).

And next, reload bash and run

echo $PYTHONPATH

if response not null, thats ok

Upvotes: 1

Liam
Liam

Reputation: 1041

The issue was resolved by adding /usr/local/lib/python2.7/site-packages to PYTHONPATH. Thanks to the comments found here:

https://stackoverflow.com/a/13103438/1729686

and to @Kash and @qqvc for the suggestions!

Upvotes: 1

Related Questions