Python run main.py prompt: ModuleNotFoundError_ No module named'requests' and how to check the python installation location

About viewing the python installation location

  1. Open the CMD command window (make sure you have installed the python environment in advance, check whether the py environment is installed: py -v)
  2. Type where python
    3.The carriage return path comes out

ModuleNotFoundError: No module named ‘requests’

When running the Python program, the following error appears: No module named'requests'
Solution:
Select run from the start menu, enter cmd to run, and then the cd command enters the Scripts file in the python installation directory,
Order

Then typepip install requests,Enough.

But my pip version is too low, and an error is reported:
pip version is too low

ERROR: Could not find a version that satisfies the requirement requests (from versions: none)
ERROR: No matching distribution found for requests
WARNING: You are using pip version 20.1.1; however, version 20.3.3 is available.
You should consider upgrading via the 'c:\users\tmz\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip' command.

Just copy + paste the command below!

python -m pip install --upgrade pip -i https://pypi.douban.com/simple

No error is reported after input, that is, successful installation, try to input againpip install requests, Success: It
Insert picture description here
prompts that the pip version is too low again, but it is very intimate that I gave me all the upgrade commands: It
Insert picture description here
prompts that pip is successfully upgraded:
Insert picture description here

Guess you like

Origin blog.csdn.net/EasyTure/article/details/112306224