No module named pip windows venv

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

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

Читайте также:  Mediatek mt7610u driver linux

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):

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:

Читайте также:  Как изменить расположение папки onedrive windows 10

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:

  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.

Читайте также:  Правильно ставим windows 10

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 .

No module named pip._vendor #6898

Comments

policetonyR commented Aug 19, 2019

Environment

  • pip version: 19.0.3?
  • Python version: 3.7.4
  • OS: Windows 10

Description
Pip is erroring out anytime it’s ran

Expected behavior
To run pip

How to Reproduce
Run pip and have my pc (honestly no clue)

Output

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

policetonyR commented Aug 19, 2019

i’ve realized my version is 19.2.2

venthur commented Aug 20, 2019

Cannot reproduce this on Linux:

pradyunsg commented Aug 20, 2019

Hi @policetonyR! Since you’ve not provided any hint as to why the issue is occurring, could you download https://bootstrap.pypa.io/get-pip.py and run it with the python.exe file in C:\Users\Owner\AppData\Local\Programs\Python\Python37-32 ?

policetonyR commented Aug 24, 2019

already tried that and just tried it. the python prompt closed after it said it found installation and reinstalled.

chrahunt commented Aug 26, 2019

Are you still getting the same exact error? Can you check if there are files in C:\Users\Owner\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\ ?

policetonyR commented Aug 26, 2019

chrahunt commented Aug 28, 2019

Somehow your installation has been corrupted — maybe overzealous anti-virus or some command was stopped partway through. In any case that pip is missing files.

You may try to remove C:\Users\Owner\AppData\Roaming\Python\Python37\site-packages\pip\ and C:\Users\Owner\AppData\Roaming\Python\Python37\site-packages\pip-*.dist-info\ (with the pip version instead of * ) then install it again with the instructions given above.

policetonyR commented Aug 28, 2019

that worked thanks

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.

pip3 install not working — No module named ‘pip._vendor.pkg_resources’

When trying to install a package for Python 3 (in Ubuntu), using pip3 install packageName (or sudo pip3 install packageName ), I get the following error message:

I have been reading for days and have tried the following WITHOUT any success:

  1. Un-installing and re-installing pip3 using the following code: sudo apt-get remove python3-pip followed by sudo apt-get install python3-pip . This was suggested in several posts that say that sometimes pip3 doesn’t install properly for Ubuntu. However, it didn’t work.
  2. Other post suggested it was an ssl package problem and that if the ssl package doesn’t load on Python3, that’s the issue. However the following command does not raise any error: python3 -c «import ssl» .
  3. Some other post suggested the problem was with the requests package. I then tried sudo apt-get remove python3-requests followed by sudo apt-get install python3-requests also to no avail.

Other information you may need:

    pip3 —version gives me the same error reported above.

dpkg -L python3-pip gives me the following information:

How can I make pip3 work?

NOTE: pip for Python2 works just fine.

  1. When trying to import setuptools in Python3 I get the following error:

    When running the following command sed -n ‘31,37p’ in the terminal, I get the following:

    My python3 —version is Python 3.5.2 .

    List of installed packages obtained running the code ls /usr/lib/python3/dist-packages .

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