- ModuleNotFoundError: No module named ‘pip’ #5710
- Comments
- GarbageYard commented Aug 17, 2018
- benoit-pierre commented Aug 17, 2018
- pradyunsg commented Aug 17, 2018
- GarbageYard commented Aug 17, 2018
- benoit-pierre commented Aug 17, 2018
- GarbageYard commented Aug 17, 2018
- benoit-pierre commented Aug 17, 2018
- GarbageYard commented Aug 17, 2018
- bukreevai commented Jan 7, 2019
- aonamrata commented Jan 8, 2019
- pip — No module named ‘pip’ even after successful installation
- 4 Answers 4
- Why am I getting ImportError: No module named pip ‘ right after installing pip?
- 14 Answers 14
- ImportError: No module named pip
- 25 Answers 25
- /usr/local/bin/python: No module named pip
- 6 Answers 6
- Not the answer you’re looking for? Browse other questions tagged python linux pip or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
ModuleNotFoundError: No module named ‘pip’ #5710
Comments
GarbageYard commented Aug 17, 2018
Environment
- pip version: 9.0.3
- Python version: 3.6
- OS: Windows Server 2016 Datacenter
Description
My system admin installed Python 3.6 for me in my AWS workspace and i requested him to update the pip version to 18 but while he was trying to upgrade the version, he ran into error. All below-mentioned commands were executed from a Powershell window in Administrative mode:
Output
Are we doing something wrong here? I also checked few links that suggested using easy_install. I tried that as well but ran into issues.
The text was updated successfully, but these errors were encountered:
benoit-pierre commented Aug 17, 2018
easy_install is deprecated, don’t use it.
First: use python -m pip when updating pip on windows (otherwise pip’s launcher cannot be updated). It also looks like you might be suffering from #5701.
pradyunsg commented Aug 17, 2018
You’d want to use python -m pip install —upgrade pip . That’s the only way to upgrade on Windows, since Windows doesn’t allow updating an executable as it’s being used (which is what happens with pip install —upgrade pip ).
GarbageYard commented Aug 17, 2018
@benoit-pierre / @pradyunsg : I tried both suggestions but i am getting the following issue:
benoit-pierre commented Aug 17, 2018
Yes, because you current installation is broken, I suggest re-installing from get-pip.py.
GarbageYard commented Aug 17, 2018
I just tried that as well as mentioned here but getting SSL issue.
Any way i can fix this error?
benoit-pierre commented Aug 17, 2018
Manually download it from your browser?
GarbageYard commented Aug 17, 2018
Thanks @benoit-pierre! After reading your last comment, was feeling embarrassed. 😛 It worked using get-pip.py. Thanks a lot! 👍
bukreevai commented Jan 7, 2019
@benoit-pierre ,
I’m install Pip wiht get-pip.py
Installing collected packages: pip, setuptools, wheel Successfully installed pip-18.1 setuptools-40.6.3 wheel-0.32.3
And I have the same error.
OS: Win 10 x64
Python: 3.6.7
aonamrata commented Jan 8, 2019
I had similar issue where installing chalice was uninstalling pip..
pip — No module named ‘pip’ even after successful installation
I am trying to install pip on my Windows 10 system. I got the get-pip.py file and ran the command
Here’s a snapshot of the terminal
Now when I try to check the version with
Why is this happening? It JUST said pip installed successfully and when I try to see the version to check if its installed, it says No module named ‘pip’
Also, I have included C:/Program/Files/Python/python3/Scripts in the PATH variable.
4 Answers 4
After running python get-pip.py, python install-dir will increase dir Lib\site-packages
Method 1. try to cp the pip dir into the python install-dir
Method 2. change file python3x._pth in python install-dir,append this line Lib\site-packages
run pip, problem will be solved
The following steps may be followed to install pip on windows:
- Download python file: get-pip.py (nearly 1.8 MB size) from link: https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py and save it to your desktop
- Go to command prompt and Check your python version: c:> python
- From command prompt run: c:> python get-pip.py
- The above will install new version of pip. check by running C:> pip —version
- You may also update setup tools — C:> pip install —upgrade pip setuptools
Use following commands can be used to find out whether pip extraction path is included or not.
if Lib\site-packages path is not included then update file python37._pth .
Run the command again and path should be visible.
pip install worked successfully for me after this.
Thanks @demianzhang for the hint or even for the solution.
Why am I getting ImportError: No module named pip ‘ right after installing pip?
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
14 Answers 14
Just be sure that you have include python to windows PATH variable, then run python -m ensurepip
What solved the issue on my case was go to:
And run below command:
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:
If you don’t you will get this error:
ModuleNotFoundError: No module named ‘pip’
python-3.8.2-embed-amd64\python.exe: No module named pip
- Open the pythonxx.__pth file, located in your python folder.
- Edit the contents (e.g. D:\Pythonx.x.x to the following):
try to type pip3 instead pip. also for upgrading pip dont use pip3 in the command
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.
turned out i had 2 versions of python on my laptop
both commands worked for me
both with another installation path
only the first path was in my %PATH% variable
I’v solved this error by setting the correct path variables
Running these 2 commands helped me:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
I was facing same issue and resolved using following steps
1) Go to your paython package and rename «python37._pth» to python37._pth.save
3) then run python get-pip.py
4) pip install django
This issue occurs with me while I was trying to upgrade pip version. It was resolved with the following commands:
The above command restores the pip and below mentioned upgrades it.
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! 😀
then you have uninstalled pip instead install pip. This could be the reason of your problem.
The Gorodeckij Dimitrij’s answer works for me.
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 StackOverflow 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 and also the path of pip module. In my case it was c:\python38 and c:\python38\scripts
ImportError: No module named pip
OS: Mac OS X 10.7.5 Python Ver: 2.7.5
I have installed setuptools 1.0 with ez_setup.py from https://pypi.python.org/pypi/setuptools Then I download pip.1.4.1 pkg from https://pypi.python.org/pypi/pip/1.4.1.
Run (sudo) python setup.py install in iTerm shows that
Then I inputed pip install , the error message showed like that
Anyone who met the same problem before and can give me some tips to solve it?
– MartinP Jun 14 ’16 at 22:51
25 Answers 25
I had the same problem. My solution:
On Mac using brew is a better option as apt-get is not available. Command:
In case you have both python2 & python3 installed on machine
simply should solve the issue.
If instead you are missing pip from python 3 then simply change python2.7 to python3 in the command above.
With macOS 10.15 and Homebrew 2.1.6 I was getting this error with Python 3.7. I just needed to run:
Now python3 -m pip works for me.
After installing ez_setup, you should have easy_install available. To install pip just do:
Try to install pip through Python:
and download get-pip.py , and then run:
On some kind of linux like ubuntu, first, do apt-get update and then try installing the python-pip package. without apt-get update, you might get error such as
E: Unable to locate package python-pip
2.Install the pip package
Then run the following command in the folder where you downloaded: get-pip.py
I ran into this same issue when I attempted to install the nova client.
I use homebrew so I worked around the issue with sudo easy_install pip
The commands should be similar if you use macports.
I think none of these answers above can fix your problem.
I was also confused by this problem once. You should manually install pip following the official guide pip installation (which currently involves running a single get-pip.py Python script)
after that, just sudo pip install Django . The error will be gone.
I downloaded pip binaries from here and it resolved the issue.
I know this thread is old, but I just solved the problem for myself on OS X differently than described here.
Basically I reinstalled Python 2.7 through brew, and it comes with pip.
Install Xcode if not already:
Install Brew as described here:
Then install Python through Brew:
And you’re done. In my case I just needed to install pyserial.
I encountered the same error with Python 3.8.6 on MacOS Big Sur.
Whether I used pip or pip3 I’d get this error:
It turns out my virtualenv was out of date. This fixed the issue for me:
- Remove the old virtualenv
- Initialise a new virtualenv
- Install the new requirements then worked:
In terminal try this:
in my case i get:
So pip2 || pip2.7 in my case works, and pip
I solved a similar error on Linux by setting PYTHONPATH to the site-packages location. This was after running python get-pip.py —prefix /home/chet/pip .
my py version is 3.7.3, and this cmd worked
python3.7 -m pip install requests
requests library — for retrieving data from web APIs.
This runs the pip module and asks it to find the requests library on PyPI.org (the Python Package Index) and install it in your local system so that it becomes available for you to import
Tested below for Linux: You can directly download pip from https://pypi.org/simple/pip/ untar and use directly with your latest python.
Check for the contents.
Here’s a minimal set of instructions for upgrading to Python 3 using MacPorts:
I ran some old code and it works again after this upgrade.
Followed the advise on this URL, to rename the python39._pth file. That solved the issue
I just needed to replace pip with pip3 so I ended up running the command as follows: pip3 install matplotlib
I had a similar problem with virtualenv that had python3.8 while installing dependencies from requirements.txt file. I managed to get it to work by activating the virtualenv and then running the command python -m pip install -r requirements.txt and it worked.
Then Install pip:
Then Install biopython:
I wish it would be useful
I encountered the issue ModuleNotFoundError: No module named ‘pip’ when I created a new Python 3 virtual environment using the command
which is a command often suggested (here, elsewhere). When I entered that venv, pip was nowhere to be found.
In the interim, since first using that command to create Python virtual environments, my system Python had upgraded (Arch Linux system updates) from Python 3.7.4 to Python 3.9.2.
The solution is to use the command
When I did that ( python -m . not python3 -m . ), that venv now contained pip .
/usr/local/bin/python: No module named pip
I installed pip but if i try to install a package with
I m new to linux and i have no idea how to figure out where the problem is.
6 Answers 6
My situation is that the python3 works fine, but pip3 does not work (the default python version is python2.7, but it doesn’t matter). I solve this problem by the following command:
And if you are not the root user, you may need to add sudo in the beginning of the command. Hope it can help.
Pip is a python packaging module that helps us too install python libraries. To install python libraries/modules ,you need to install pip-
My OpenSuse box at work did not have pip installed and yast did not find it. I figured out that yast was only pointing to a local package-repository which apparently was missing pip. I have added the official OpenSuse repository, which I found here https://en.opensuse.org/Package_repositories and then was able to find and install pip.
I had to do something similar, tom’s answer didn’t quite work on Digital Ocean, Ubuntu 14.04.05
See if the package is installed in the site-packages of your python version.
Gives the path where all your packages reside for particular python version. import sys, os; print os.sep.join([sys.prefix, ‘lib’, ‘python’ + sys.version[:3], ‘site-packages’]) ;
if you find requests there , then import requests should work. Otherwise add the above path to your python’s path by using the below code.
I had a similar problem, due to manual installing of python. I fixed the problem with the @Soroosh answer in https://askubuntu.com/questions/324202/dpkg-error-processing-python-minimal-configure . Hope it helps. It can take 5 minutes.
Not the answer you’re looking for? Browse other questions tagged python linux pip or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.