简体   繁体   中英

Can't install pyqt5 on python 2.7

I want to install pyqt5 on python 2.7. I've tried to download on their website, but I can't open the website. I used:

pip install

and I got:

ERROR: Could not find a version that satisfies the requirement pyqt5 (from versions: none)
ERROR: No matching distribution found for pyqt5

You didn't mention an OS, but here is my experience with OSX - hopefully it is helpful to someone.

pyqt5 installed though pip appears to require python3 - and I couldn't find a way around it. After spending a bit of time trying to figure this out recently, there are two options I know of:

1) build from source, eg https://robonobodojo.wordpress.com/2017/02/08/installing-pyqt4-on-mac-osx/ , https://fredrikaverpil.github.io/2015/11/25/compiling-pyqt5-for-python-2-7-on-os-x/ , for pyqt4 (just in case), pyqt5, respectively.

2) install using conda https://docs.conda.io/en/latest/miniconda.html

I was unable to get 1) working for me (on OSX 10.14.5) due to, I believe, an issue with paths configuration. But conda worked immediately. Once installed (by choosing the python2 install), just do conda install pyqt .

edit: there is also an Ubuntu guide for building from source here : https://plashless.wordpress.com/2014/03/26/building-pyqt5-for-python2-7-on-a-clean-ubuntu-13-10-build-machine/

pyqt5 需要 python 3.4 或更高版本

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