Install Pyqt4 with brew

Im working with brew to install PyQt on python3, but I can't get it to work

I launched brew install pyqtand brew doctorto fix all the possible errors, but when I run my code, I keep getting

ImportError: No module named 'PyQt4'

If I run echo $PATHim, getting/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin

Can someone help me solve this problem? I also use PyCharm, but I still get the same error if I run in terminal python3, thenimport pyqt

Please help me :( im really new in this, but I tried everything I could find on google

thank!

PD: Starting brew test pyqtdoes not result in an error, but it does not open. I also installed python3 with brew and im currently running it from/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/bin/python3.4

+4
source share
4 answers

If you want to use PyQt4 with Python 3, you should use this command to tell homebrew:

brew install PyQt --with-python3

+6
source

I had the same problem. Installation using the Longhanks instructions did not work because it was already installed. I worked with

brew reinstall PyQt --with-python3

0
source

python 2.7. 2.7 python, , 3.4 ( , ).

python /usr/local/lib/python2.7/site-packages, python
:

mkdir -p /Users/zgf/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/zgf/Library/Python/2.7/lib/python/site-packages/homebrew.pth

zgf OSX.

You can also copy the appropriate files from /usr/local/lib/python2.7/site-packagesto your personal python site package directory or the shared site directory directory (/Library/Python/2.7/site-packages) if you can root.

0
source

Install PyQt for Python 3

brew reinstall PyQt --without-python
-1
source

All Articles