Detailed process of installing python3.8 and pyqt5 on win10 system

Install python

1. Download and install the software package.
Log in to the official website: https://www.python.org/downloads/
Insert image description here
Select the version to download according to the operating system. My system here is a 64-bit system, so I chose the 64-bit installation package and tested the installation of 32-bit. It can also be used. Let’s install the 64-bit version here.
Insert image description here

2. Install python

After downloading, double-click to start the installation. You can choose classic installation or custom installation. I choose custom installation here so that you can choose the installation directory.
Insert image description here
Insert image description here

3. Configure environment variables
and enter cmd input:

path=%path%;C:\Python\Python38

C:\Python\Python38 represents the installation path of python, which can be changed according to your own situation.
Add Scripts to it and enter again:

path=%path%;C:\Python\Python38\Scripts

4. To check whether the installation is successful,
type python in cmd and press Enter. The picture below indicates success.
Insert image description here

Install PyQt5

1. After python is installed successfully, you can try the pip command in the cmd window. If there is no problem, we need to install sip first. The specific command is as follows:

pip install sip

2. Now you can install PyQt5, use the following command

pip3 install PyQt5

3. An error occurred during installation.
Insert image description here
For such problems, you need to specify the installation path.

pip install --target=c:\python\python38\lib\site-packages urllib3

Adding the installation path after –target= will solve this problem.

However, you may still have the following problems in the future. The foreign source is too slow, and the progress is still there. It cannot be installed properly. Change to a domestic source.

pip install pyqt5  -i https://pypi.doubanio.com/simple/

4. Check it out

pip list

Insert image description here
Try it on IDLE,
Insert image description here
no error is reported when importing, it’s normal! !
5. Install the QT toolkit and continue to use Doubian’s source

pip install PyQt5-tools -i https://pypi.douban.com/simple

Guess you like

Origin blog.csdn.net/llq_the7/article/details/107833777