Tag Archives: Python installation

Python installation of third-party libraries reported an error: “these packages do not match the hashes from the requirements file.”

Problem: an error “these packages do not match the hashes from the requirements file” appears when installing the third-party library

Reason: the download error is usually caused by the network speed problem, resulting in the corresponding hash value does not match.

Solution: when pip is needed, add the “- upgrade” parameter. Usually, the download will report an error timeout at this time, so adding a “- default timeout = 100000” is more secure (the value of timeout can vary according to the situation).

pip install --upgrade --default-timeout=100000 packagename

Later, when installing pyqt5, I encountered the same problem. I still reported an error by using the above method. After using the online method, I solved the problem

# Install pyqt5
pip install PyQt5 -i https://pypi.douban.com/simple
# Install pyqt5-tools
pip install PyQt5-tools -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com

Solution of modulenotfounderror in running pychar

Solution of modulenotfounderror in running pychar

You need to load the corresponding module file in pychar. The specific steps are as follows: left click in file, select settings, and select【 python:xxx 】Click [Python interperter] in the toolbar to open the page and select [add] in the toolbar, After the page appears, select [existing environment] to load python.exe File my python.exe The file is in the following location: C: users, administrator, appdata, local, programs, python, python38

Common problems

one python.exe There is no required module file in the file

At this time, you need to use pip to install the corresponding files. The installation steps are as follows:
1. Open CMD
2. Enter the CD in the folder (the following is my path) C:: (users / administrator / appdata / local / programs / Python / python38 / scripts)
3. Start to install the file PIP install flash (take installing flash as an example)
4. Check if the installation is complete, you can use pip to install flash List to determine whether the installed file is in the list

2. “PIP” is not an internal or external command

1. Confirm that “PIP” is not an internal or external command, nor a runnable program or batch file.

2. Solution 1: go to the folder where pip is located, and copy the path
my path is: C:: (users, administrator, appdata, local, programs, python, python38, scripts)

3. Switch the working directory to the path of PIP
CD

4. Execute PIP again, method 1, success!

5. Method 2: add pip to environment variables
right click my computer and select properties

6. Select: Advanced – environment variable

7. Open path to edit, and add the directory path of PIP at the end

8. After confirming the setting of environment variables, method 2 is successful!

Python installation tutorial

Python Installation Tutorial
I. The blogger speaks for himself
With the rapid development of artificial intelligence, Python language is becoming more and more popular among people. The blogger taught himself a while ago, but this time he consolidated it again and shared the pits I met with with you. To help you learn less detours.
Hope to be helpful to you, welcome to leave a comment and ask questions.
At the bottom of the PS article is my python3.7 package download link, which you can download yourself.
 
Ii. Installation environment
The installation environment of this tutorial is: Win7 or Win10 system
Python version: Python 3.7.
As for the installation of Linux and other python versions, you can refer to them.
 
Three, installation steps
1. Python3.7 will be downloaded from the official website
1. To download the Python version on the official website of Python, you need to download the corresponding version (check whether you are a 32-bit operating system or a 64-bit operating system in the computer-Property). I am 64-bit, so I download the corresponding installation package (as shown in the figure below: Windows x86-64 Executable Installer).
The official website download address is as follows:
https://www.python.org/downloads/windows/

 
Notes:
If you typed https://www.python.org, you’ll have to look for the option on the page. It’s better to just type in the details.
Python can also download a ZIP version (Windowsx86-64 Embeddable Zip file), but sometimes many DLL files are lost after downloading, and it is difficult to fix these problems. Therefore, it is recommended to download the Windows X86-64 Executable installer.
2. Python3.7 installation tutorial
1) Double-click the downloaded EXE program to enter the installation interface after downloading.
The installation interface can choose the default installation, also can customize the installation, I prefer the custom installation, default installation path is relatively deep, custom installation define their own shallow directory, easy to find the following.

 
2) When choosing the path to install, you can check “Add Python 3.6 toPATH” at the bottom. This will Add user variables directly by default, and you don’t need to Add them later

3) After the selection, proceed to the next step. All default choices are ok. If necessary, the path of installation and storage can be directly updated in the next step.

4) If the next step continues, the installation will be prompted. You can also see the relevant information in Figure 2 below in the installation directory. Execute Python-V (capital V oh) in CMD at the same time to see the successfully installed version.
At this point, Python is successfully installed and ready to use.

5) The schematic diagram after installation is as follows


3. IDLE use
After the installation is completed, we find Python IDLE in the start menu and double-click to run it, and then we can debug our Python code in our IDLE.

 
Remark:
The above mentioned is the process of Python IDLE installation and debugging in Windows platform. Usually, The Linux system, such as Ubuntu and CentOS, has installed Python programs with the system by default. In Linux system, IDLE is called Python interpreter, and it starts from the terminal emulator by typing the command “Python”. Everything in Python starts with this IDLE editor, and after getting started, you can choose more of your favorite Python editors, such as Wing IDE, the professional Python editor.
 
Iv. Summary of matters needing attention
1: Go to www.python.org to download. (My computer is a Windows system, so the 3.7 version I downloaded is Download Windows X86-64 Executable Installer)
2: Run directly after downloading and customize installation. (Remember to check Add Python 3.7to PATH)
3: Enter python-V test in the Python directory after installation
4: After success, search for IDLE in the start menu. Just double-click to run it (IDLE comes with the Python download and is the INTEGRATED development environment for Python)
 
5. Download address
I have uploaded the Python package, and you can download it directly, either from the official website or from my link address.
download:
https://download.csdn.net/download/qq_25814003/10464931