Under win10, how to solve the problem of "No module named 'pip'"?
first introduce the situation:
1. Python is decompressed with zip and configured with environment variables. Python can be run under cmd.
2, https://bootstrap.pypa.io/get. downloaded the script and ran python get-pip.py
to complete the download.
3. There are these things in the python/Scripts folder:
here"s the problem:
running PowerShell, under the python/Scripts folder, running pip, returns the following information.
PS D:\z_tools\python-3.7.0\Scripts> .\pip.exe
Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "D:\z_tools\python-3.7.0\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named "pip"
PS D:\z_tools\python-3.7.0\Scripts> python -m pip
D:\z_tools\python-3.7.0\python.exe: No module named pip
what is the reason, please? Is there any package I still lack that I haven"t downloaded?
I have the same problem as the subject
- install python by decompressing the package
- the relevant environment variables of python are fully configured
- run
python get-pip.py
install pip
- use pip to get the error "No module named 'pip'"
after observation, after running python get-pip.py
, there are more folders Lib\ site-packages
in the python installation directory (for the subject, "D:\ z_tools\ python-3.7.0"
). Try to copy the pip directory to the python installation directory, run the pip command again, and the error disappears.
undo the copy, modify the python3x._pth
file under the python installation directory, and add a new line Lib\ site-packages
.
run the pip command again, everything is fine, and the problem is solved.
there are two suggestions. Download the installation package again on the official website. Installation is an option for attention. Check pip installation.
or easy_install pip install
install IDE alone may not be very friendly to beginners, you can download Anaconda as a use, in this case, you can try two, the first is to test the pip3, refers to directly in the cmd type pip or pip3, can also try to go to sites such as pypi or pypa to download the appropriate installation package, execute the corresponding setup.py.
reinstall with the conda instruction
< H2 > win10 system, similar issues have been resolved < / H2 >
< H2 > win10 system version 1903 64-bit < / H2 >
python version 3.6.8
< H2 > error reporting operation < / H2 >
- prompts you to upgrade pip to 19.2.3 when executing pip install pack
- execute pip install-- upgrade pip
- the error message for executing pip install after installation is as follows:
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "D:\program\python\Scripts\pip3.exe\__main__.py", line 5, in <module> ModuleNotFoundError: No module named 'pip'
< H2 > executing pip in the root directory also reported an error < / H2 >
No module named 'pip'
< H2 > solution < / H2 >
- go back to the python script directory and execute easy_install pip
\python\Scripts> .\easy_install.exe pip
- the installation process is as follows
Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl-sharpsha256=340a0ba40fdeb16413914c0fcd8e0b4ebb0bf39a900ec80e11c05d836c05103f
Best match: pip 19.2.3
Processing pip-19.2.3-py2.py3-none-any.whl
Installing pip-19.2.3-py2.py3-none-any.whl to d:\program\python\lib\site-packages
Adding pip 19.2.3 to easy-install.pth file
Installing pip-script.py script to d:\program\python\Scripts
Installing pip.exe script to d:\program\python\Scripts
Installing pip3-script.py script to d:\program\python\Scripts
Installing pip3.exe script to d:\program\python\Scripts
Installing pip3.7-script.py script to d:\program\python\Scripts
Installing pip3.7.exe script to d:\program\python\Scripts
Installed d:\program\python\lib\site-packages\pip-19.2.3-py3.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
< H2 > pip list repair performed successfully < / H2 >
PS D:\program\python\Scripts> pip list
Package Version
---------- -------
pip 19.2.3
pypinyin 0.35.4
setuptools 40.6.2
< H2 > error reason < / H2 >
at present, my analysis is that win10 does not use administrator permissions when performing an upgrade under cmd, so that the 19.xx.whl file downloaded after the execution of upgrade does not have the right to execute. At this time, some of the original configuration files have been modified so that the path related to the pip module cannot be found. It is recommended that administrator rights be granted to shell when starting pip upgrade under windows in the future
I also encountered this problem. When I saw the comments here and went to the python37._pth file, I found that all I had to do was open the commented-out import site