简体   繁体   中英

Installing PyQt4 for Python 3 mac

I'm having trouble getting PyQt4 to work with Python 3. I was able to get PyQt5 to work but all the tutorials seem to be using PyQt4 for web scraping so it looks like I'm forced to use PyQt4.

I've followed the directions at

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

but whenever I get to the 'make install' part everything is copied over to my Python 2.7 directory where it works for Python 2.7.

I tried setting the destination directory

python3 configure.py -destdir/Users/ryan/anaconda/lib/python3.4/site-packages/

but it still installed to the python 2 dir. I also tried setting the python version

python3 configure.py --target-py-version 3.4

but it returns

configure.py: error: no such option: --target-py-version

You can use homebrew . Once brew installed, simply type the following commands in your terminal:

brew install sip --with-python3
brew install pyqt --with-python3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM