python pip problem

1. Today, when I used pip to download some modules of python, I suddenly stopped working and reported ModuleNotFoundError: No module named'pip' . I was very depressed. Obviously I have pip. I looked at the environment variables and it was good. In this way, uninstall pip and reinstall it. Anyway, it takes a few seconds. The instructions are as follows:
first execute python -m ensurepip and then execute python -m pip install --upgrade pip , which will reinstall the latest version of pip.
2. When using pip to install many modules, it is very troublesome to execute pip install XXX one by one. You can put all the modules that need to be installed into a configuration file, in the following format:
Insert picture description here
backcall0.1.0
colorama
0.4.1
decorator4.4.0
Django
2.2
ipython7.4.0
ipython-genutils
0.2.0
jedi0.13.3
mysqlclient
1.3.13
parso0.4.0
pickleshare
0.7.5
prompt-toolkit2.0.9
Pygments
2.3.1
pytz2018.9
six
The number after 1.12.0
sqlparse==0.3.0
indicates the version number of the corresponding module.
Here I put these contents in the requirement.txt file in the root directory of the project,
open the corresponding console directory, and execute pip install -r requirement.txt All modules will be downloaded automatically.

Guess you like

Origin blog.csdn.net/qq_39719415/article/details/96111233