Modulenotfounderror no module named pip windows

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..

ModuleNotFoundError: No module named ‘pip._vendor’ after upgrading pip #6261

Comments

jibanhenry commented Feb 13, 2019 •

Environment

  • pip version:19.0.1
  • Python version:3.7
  • windows:10
Читайте также:  Nvidia geforce gtx 760 windows 10 driver

Description
After upgraded, pip can not be used. It produced the error «ModuleNotFoundError: No module named ‘pip._vendor’ «

What I have run

The text was updated successfully, but these errors were encountered:

CDuPlooy commented Feb 19, 2019

I did the following on linux;

Hopefully it helps someone!

This comment was marked as off-topic.

This comment was marked as off-topic.

arjunv commented Mar 11, 2019 •

I did the following on linux;

Hopefully it helps someone!

You need only remove the pip package and not all the installed packages in site-packages!

rm -rf /usr/lib/python3.7/site-packages/pip
python3.7 -m ensurepip
pip install —upgrade pip

pradyunsg commented Mar 11, 2019

Which version of pip did you upgrade from?

arjunv commented Mar 12, 2019 •

Which version of pip did you upgrade from?

In my case I think it is some sort of clash between the python-pip installed via package manager (I’m using arch distro) and pip when installed using ensurepip i guess?
That’s currently the only way I’m able to reproduce the issue.

saltasatelites commented Mar 17, 2019 •

gavindsouza commented Mar 23, 2019

On 5.0.3-arch1-1-ARCH with pip-19.0.3

I fixed the issue by

Uninstalling pip and removing related files using the package manager
yay -Rscn python-pip

followed it by an install using the package manager (pip-18.1)
yay -S python-pip

Followed by a upgrade pip, from the installed pip-18.1 to pip-19.0.3
pip install —upgrade pip

saltasatelites commented Mar 23, 2019 •

In my case, deleting /usr/lib/python3.7/site-packages/pip and reinstalling Python-pip with pacman fixed the issue. (I’ve installed python-pip 18.1-2)

LmwLeave commented May 8, 2019

我是窗口,提示有1.1.1更新,,怎么试都不行,弄了一天,报错:从点子。内部导入主要作为主#isort:skip #noqa
文件“D:\ Program Files(x86)\ Python37-32 \ lib \ site-packages \ pip-19.1.1-py3.7.egg \ pip_internal init .py”,第19行,
来自pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError:没有名为’pip._vendor’的模块。最后删除脚本下的pip的文件,然后python -m ensurepip,再easy_install.exe pip,解决了

LmwLeave commented May 8, 2019

我是win10,提示有1.1.1更新,,怎么试都不行,弄了一天,报错:从点子。内部导入主要作为主#isort:skip #noqa
文件“D:\ Program Files(x86)\ Python37-32 \ lib \ site-packages \ pip-19.1.1-py3.7.egg \ pip_internal init .py”,第19行,
来自pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError:没有名为’pip._vendor’的模块。最后删除脚Scripts下相关的pip的文件,然后python -m ensurepip,再easy_install.exe pip,解决了

chrahunt commented Jul 25, 2019

Hi @jibanhenry. If this is still affecting you please let us know and we can dig into it more.

For anyone else experiencing issues, please do not hesitate to create an issue with details.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

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

  1. Open the pythonxx.__pth file, located in your python folder.
  2. Edit the contents (e.g. D:\Pythonx.x.x to the following):
Читайте также:  Как установить windows со всеми драйверами

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

Читайте также:  Кто занял файл windows

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:

  1. Remove the old virtualenv
  1. Initialise a new virtualenv
  1. 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 .

Оцените статью