As the title suggests, this article only applies to Python3.6 in Windows, and note that PyQt4, not PyQt5, will be installed. This is important because if you’ve ever used Python’s third party drawing libraries, Matplotlib and Seaborn, you’ve noticed that they both rely on PyQt4 (whatever PyQt5 does, it’s PyQt4, not PyQt5. If you have PyQt5 installed but don’t have PyQt4, you still can’t use them). In general, if you are using Anaconda3 as the Python interpreter, the Python version that contains PyQt4 can be viewed using conda list (the Python3.6 version comes with me). If, by some accident, PyQt4 is accidentally uninstalled, you use one of the two libraries mentioned above and it is “No module named PyQt4”, or “Pyqt4.gui, Pyqt4.core”, etc. There are several common ways to solve such problems online:
(1) Download The Windows Installers version of PyQt4 directly from the official website, namely the EXE file, and install it directly. Unfortunately, it looks like the official site has been revamped and I can’t find a ready version of Windows x 32 or x 64 for Python3.6 anyway.
(2) now the official website published the version of window after downloading is an uncompressed version, but not directly can be used, and need to re-make installation, more troublesome.
(3) a commonly used PIP or conda automatic installation does not reveal the existence of readily available resources for the Windows platform.
A very simple and efficient way to do this is to download it directly. WHL, which is available here (http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4), is a convenient way to choose between different Python versions, Windows 64bit or 32bit. After downloading, you can put the file into the Python installation directory, and then enter the CD into the directory under CMD or anaconda prompt. Enter the command, such as: PIP install pyqt4-4.11.4-cp36-cp36m-win_amd64. WHL
, and wait for the completion of the installation. At this point, import seaborn as SNS
or import matplotlib.pyplot as PLT
can be executed normally.
Read More:
- Installing sklearn (scikit learn) module related to Python machine learning in Windows
- Python – writing visual interface (Python + pycharm + pyqt)
- Package python3.1 + PyQt4 into exe
- Python 3 install pyqt5
- Error in installing paddlenlp on pip on Windows
- Under win864 bit, install python, PyQt4 and sip. (final failure, only record)
- Installing Windows Identity Foundation on Windows 8 – The Certificate for the signer of the message …
- Error during connect when installing docker in Windows 10
- Error in installing canal server for windows
- About installing SQL server 0 in Windows 10 20h2 × 84bb0001 is one of the solutions
- Solve the problem of Python in Windows environment: Fatal error in launcher: Unable to create process using’”‘ in pip installation
- Error in installing pywin32 under Windows: close failed in file object D estructor:sys.excepthook is missing lost sys.stderr
- Installing opencv Python in docker container
- Error installing NX10.0 in win10. Tip: ZeroGu6: Windows DLL failed to load
- Error in installing Matplotlib Library: permissionerror: [errno 13] permission denied: ‘/ usr / local / lib / python3.6’
- Countermeasures for Error 1935 when installing MATLAB under Windows 10
- Error when starting Python in Windows
- Solve the problem of prompt couldn’t find path to unrear library after installing unrear in Python
- Installing Theano :Windows Installation Instructions
- Installing R’s “mvtnorm” package in Windows system: solving the problem of the R package “mvtnorm” is not installed