解决ModuleNotFoundError: No module named 'requests'
About viewing the python installation location
- Open the CMD command window (make sure you have installed the python environment in advance, check whether the py environment is installed: py -v)
- Type where python
3.
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,
Then typepip install requests,Enough.
But my pip version is too low, and an error is reported:
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
prompts that the pip version is too low again, but it is very intimate that I gave me all the upgrade commands: It
prompts that pip is successfully upgraded: