简体   繁体   中英

Finding PyQT5 compatible with python 2.7, MySQL and mac OS

I have installed pyqt5 using home-brew on the terminal but when I run a python 2.7 idle file and import "PyQt5" it says "ImportError: No module named PyQt5"

Have I installed it correctly, how would I check this?

From reading through the documentation ( PyQt5 docs ) it seems, that PyQt5 is only available for Python 3 and not Python 2.

Do you have Python 3 installed on your Mac? If so, then try to import it using Python 3. If you have Python 3 not installed, you can also do it via home-brew using:

brew install python3

If you need to use Python 2.7, then you should consider using PyQt4 which seems to be compatible (haven't tested, just looked up the docs).

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