Question :
I have installed pip and ez setup. I also checked the system path and I can see the module in the folder structure. Still when i try to run pip command, I get an Import error saying no module named pip. I am running 32bit python on a windows7 machine
Answer #1:
Just be sure that you have include python to windows PATH variable, then run python -m ensurepip
Answer #2:
What solved the issue on my case was go to:
cd C:Program FilesPython37Scripts
And run below command:
easy_install.exe pip
Answer #3:
Follow steps given in https://michlstechblog.info/blog/python-install-python-with-pip-on-windows-by-the-embeddable-zip-file/. Replace x
with version number of Python.
- Open the
pythonxx.__pth
file, located in your python folder. - Edit the contents (e.g.
D:Pythonx.x.x
to the following):
D:Pythonx.x.x
D:Pythonx.x.xDLLs
D:Pythonx.x.xlib
D:Pythonx.x.xlibplat-win
D:Pythonx.x.xlibsite-packages
Answer #4:
After running get_pip.py
with python embed you have to modify your pythonXX._pth
file. Add Libsite-packages
, to get something like this:
pythonXX.zip
.
Libsite-packages
# Uncomment to run site.main() automatically
#import site
If you don’t you will get this error:
ModuleNotFoundError: No module named ‘pip’
or
python-3.8.2-embed-amd64python.exe: No module named pip
? pip
Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 86, in _run_code
File "python-3.8.2-embed-amd64Scriptspip.exe__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
? python -m pip
python-3.8.2-embed-amd64python.exe: No module named pip
Answer #5:
try to type pip3 instead pip.
also for upgrading pip dont use pip3 in the command
python -m pip install -U pip
maybe it helps
Answer #6:
The ensurepip
module was added in version 3.4 and then backported to 2.7.9.
So make sure your Python version is at least 2.7.9 if using Python 2, and at least 3.4 if using Python 3.
Answer #7:
turned out i had 2 versions of python on my laptop
both commands worked for me
python -m ensurepip
py -m ensurepip
both with another installation path
c:toolspythonlibsite-packages
c:program files (x86)microsoft visual studiosharedpython36_64libsite-packages
only the first path was in my %PATH% variable
Answer #8:
I’v solved this error by setting the correct path variables
C:UsersnameAppDataLocalProgramsPythonPython37Scripts
C:UsersnameAppDataLocalProgramsPythonPython37Libsite-packages