Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get-pip.py broken on Windows 10

Tags:

python

pip

Get Pip (Python file from Pypa.io) on Windows 10 is not extracting on my laptop. I followed all the instructions on pypa.io - Installing, however, when I tried to execute the file, despite many attempts to fix this, it says:

ERROR: To modify pip, please run the following command: C:\Python27\python.exe -m pip  

So I ran C:\Python27\python.exe -m pip and then it shows another error message:

C:\Python27\python.exe: No module named pip  

I then consulted with a friend of mine, and he said that the second error message is obviously not a file error, but (me reflecting now) is quite logical. Of course it says that there is no module named pip because that was the very thing that I am trying to download. Then it occurred to me that Python must think that I already have it because it is asking me to modify pip. So I looked into this and saw that I had a pip folder but nothing inside it to do with Python.

So this made me think Why is it not downloading? or Why does it think that I already have it?

UPDATE

The Python installer now comes with an option to install pip which should solve any further problems!

Python Installer

like image 891
NR Technology Avatar asked Apr 16 '18 10:04

NR Technology


People also ask

Why pip is not working in CMD?

The error “'pip' is not recognized as an internal or external command” is encountered because of two main reasons that are. PIP Installation path is not added to the system variables: If you have installed python through prompt then you need to configure PIP path manually.

How do I install pip on Windows 10?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process.


2 Answers

Pretty sure that I had the exact same problem as you. I am using Python 2.7.14 64-bit, and when I try to install pip using get-pip.py, I get the exact same error.

I fixed this by simply running the following command:

python -m ensurepip --default-pip

This then installed pip. This is because the version of Python I downloaded is packaged with pip.

Note that this installed pip without the wheel portion, so I then had to run:

python -m pip install --upgrade pip setuptools wheel

After that, everything was ready to go.

like image 146
Alex Ziegenhorn Avatar answered Nov 04 '22 13:11

Alex Ziegenhorn


I just stumbled upon this very same issue. However, I am using (have to) Python 2.7.8 32-bit.

https://pip.pypa.io/en/latest/installing/ clearly states that

pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org

so that my call to python -m ensurepip --default-pip did in fact result in No module named ensurepip (as I am not using >=2.7.9).

Yet I was finally able to get pip running: instead of using the latest get-pip.py at https://bootstrap.pypa.io/get-pip.py I used https://bootstrap.pypa.io/2.6/get-pip.py.

For future reference, and those who want to compare against any version of get-pip.py in https://github.com/pypa/get-pip:

29af88001263a19911c0911057cc192e  ./get-pip.py      did *not* work for me,
e4bd67ad4de5329bd4291e06ee3ba012  ./2.6/get-pip.py  *did* work for me.
like image 38
whitedwarf Avatar answered Nov 04 '22 13:11

whitedwarf