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 the pip command, I get an Import error saying no module named pip. I am running 32-bit Python on a Windows 7 machine.
-
2Just use the python installer and pip will be downloaded with it. – Ahmed Tremo Apr 30 '21 at 17:35
19 Answers
Just be sure that you have included the Python executable in the Windows Environment Variables, System PATH variable, and then run:
python -m ensurepip
.
or if you have permission issue, run:
python -m ensurepip --user

- 5,284
- 7
- 19
- 45

- 4,209
- 2
- 17
- 21
-
60Error: `python.exe: No module named ensurepip`. I'm using the latest 3.7.1. – PeterX Nov 08 '18 at 23:08
-
3@Subin_Learner I had to use the installer - the ZIP version of Python simply doesn't work with PIP afaict – PeterX Nov 27 '18 at 04:13
-
2
-
6don't forget to add C:\Users\...\AppData\Local\Programs\Python\Python36\Scripts to the PATH variable so you can use pip after – Mehdi Souregi Dec 17 '18 at 09:29
-
1
-
Your command says pip requirement is satisfied but when running pip, it still get error: `Fatal error in launcher: Unable to create process using '"C:\Program Files\Python39\python.exe" "C:\Users\
\AppData\Roaming\Python\Python39\Scripts\pip While I reinforced reinstallation of pip in C:\Python39 :o :angry: – jaques-sam May 12 '22 at 08:04 -
No need to add Path, the answer of "user2226755" below is the correct one. Tried and tested. – Alen Wesker Apr 04 '23 at 02:09
-
After running get_pip.py
with Python embed, you have to modify your pythonXX._pth
file. Add Lib\site-packages
, to get something like this:
pythonXX.zip
.
Lib\site-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-amd64\python.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-amd64\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
λ python -m pip
python-3.8.2-embed-amd64\python.exe: No module named pip

- 30,738
- 21
- 105
- 131

- 12,494
- 5
- 50
- 73
-
11Thank you! This helps for my Windows 10 embedded python 3.8 installation! – David Yew Apr 02 '20 at 00:32
-
Becareful if you use virtualenv with embedded python, the environnement is not the same as normal installation some installation (with pip) can crash with error of type `ModuleNotFoundError: No module named '*******'`. – user2226755 Apr 02 '20 at 09:06
-
4
-
-
This issue occurs with me while I was trying to upgrade pip version. It was resolved with the following commands:
python -m ensurepip
The above command restores the pip and below mentioned upgrades it.
python -m pip install --upgrade pip

- 1,039
- 9
- 14
What solved the issue on my case was go to:
cd C:\Program Files\Python37\Scripts
And run below command:
easy_install.exe pip

- 449
- 4
- 5
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.x\DLLs
D:\Pythonx.x.x\lib
D:\Pythonx.x.x\lib\plat-win
D:\Pythonx.x.x\lib\site-packages

- 1
- 1

- 600
- 8
- 16
-
5
-
Another issue was https://bugs.python.org/issue34841. The current directory was not added to the path. print(sys.path) did not include the empty string. – Eugene Lycenok Jul 31 '20 at 08:03
Try to type pip3 instead of pip.
Also for upgrading pip, don’t use pip3 in the command
python -m pip install -U pip

- 30,738
- 21
- 105
- 131

- 946
- 6
- 10
It turned out I had two versions of the Python executable on my laptop.
Both commands worked for me
python -m ensurepip
py -m ensurepip
Both with another installation path
c:\tools\python\lib\site-packages
c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages
Only the first path was in my %PATH% variable.

- 30,738
- 21
- 105
- 131

- 151
- 1
- 6
First make sure that python
is added in environment variable.
Try checking the version of pip
or pip3
. Use these commands to check.
For pip
:
pip --version
For pip3
:
pip3 --version
If you can see any version of pip and still not able to use it, then run the following command.
python -m ensurepip
This ensures the pip
in your system.

- 402
- 4
- 6
I found this post while looking for a solution for the same problem. I was using an embedded Python distribution. In this case, the solution is to uncomment import site
in the file python<version>._pth
.

- 30,738
- 21
- 105
- 131

- 71
- 1
- 3
Running these 2 commands helped me:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

- 71
- 1
- 4
If you wrote
pip install --upgrade pip
and you got
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.1
Uninstalling pip-20.2.1:
ERROR: Could not install packages due to an EnvironmentError...
Then you have uninstalled pip instead install pip. This could be the reason of your problem.
The Gorodeckij Dimitrij's answer works for me.
python -m ensurepip

- 30,738
- 21
- 105
- 131

- 841
- 12
- 10
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.

- 17,084
- 9
- 43
- 67
I'v solved this error by setting the correct path variables
C:\Users\name\AppData\Local\Programs\Python\Python37\Scripts
C:\Users\name\AppData\Local\Programs\Python\Python37\Lib\site-packages

- 51
- 1
- 3
I was facing the same issue and resolved it using the following steps.
Go to your Python package and rename "python37._pth" to python37._pth.save
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
then run
python get-pip.py
pip install django

- 30,738
- 21
- 105
- 131

- 10,864
- 5
- 72
- 96
-
Who said anything about [Django](https://en.wikipedia.org/wiki/Django_%28web_framework%29)? Why is that relevant? – Peter Mortensen Jun 08 '23 at 08:06
I've solved this error downloading the executable file for python 3.7. I've had downloaded the embeddeable version and got that error. Now it works! :D

- 13
- 3
The method I'm going to tell might not be the correct way to do it. But this method solved my issue. I tried every solution on YouTube and Stack Overflow methods.
If you have two Python versions installed. Delete one. I have the Python 3.8.1 and 3.9.0 versions installed. I deleted version 3.9.0 from the C directory.
Now go to the control panel → System and security → System → Advanced system settings.
Click on 'Environment Variables'.
Select the path and click on 'Edit...'
Now, add the path of the Python executable and also the path of pip module. In my case it was C:\python38 and C:\python38\scripts.
This method solved my issue.

- 30,738
- 21
- 105
- 131

- 135
- 6
Instead of Python zip install python by python installer. It fixed the issue for me.

- 377
- 2
- 13
Here i need to do this things:
1 - Redownload python 3.9 (https://www.python.org/ftp/python/3.9.0/python-3.9.0.exe)
2 - Reinstall
3 - Edit the file python3.9._pth
C:\Laragon\bin\python\python-3.9.0
C:\Laragon\bin\python\python-3.9.0\DLLs
C:\Laragon\bin\python\python-3.9.0\Lib
C:\Laragon\bin\python\python-3.9.0\Lib\plat-win
C:\Laragon\bin\python\python-3.9.0\Lib\site-packages
# Uncomment to run site.main() automatically
#import site
4 - run the command "python -m pip install requests"

- 196
- 3
- 8
Usally upgrading the pipline will solve the problem, when upgrading check that you have the permission (in case you are working from Command Line)
python.exe -m pip install --upgrade pip

- 163
- 1
- 7