11

I am trying to install pip on my Windows 10 system. I got the get-pip.py file and ran the command

python get-pip.py

Here's a snapshot of the terminal

$ python get-pip.py
Collecting pip
Using cached 
https://files.pythonhosted.org/packages/46/dc/7fd5df840e
fb3e56c8b4f768793a237ec4ee59891959d6a215d63f727023/pip-19.0.1-py2
.py3-none-any.whl
Collecting setuptools
  Using cached 
https://files.pythonhosted.org/packages/ff/47/1dfa4795e
24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3- 
none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-19.0.1 setuptools-40.8.0 wheel-0.32.3

Now when I try to check the version with

pip -V

I get this -

Traceback (most recent call last):
 File "runpy.py", line 193, in _run_module_as_main
 File "runpy.py", line 85, in _run_code
 File "C:\Program Files\Python\python-3.6.3-embed- 
 amd64\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'

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.

Please help ! ! ! !

17
  • Have you tried to restart your laptop? Or tried any solutions provided here or here ?
    – Cen
    Feb 8, 2019 at 4:14
  • Tried to restart the system and checked with pip -V. Still getting the same "No module named 'pip' " error. :( Feb 8, 2019 at 4:20
  • try pip3 -V also not working?
    – gameon67
    Feb 8, 2019 at 4:25
  • @gameon67, same error. :'( no module named 'pip' Feb 8, 2019 at 4:26
  • 1
    navigate to c:/users/<your user>/appdata/local/programs/python/python36/scripts/, if pip.exe is in there, you have pip. Feb 8, 2019 at 4:48

9 Answers 9

19

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

or

Method 2. change file python3x._pth in python install-dir,append this line Lib\site-packages

run pip, problem will be solved

2
  • 1
    cheers @demianzhang not sure why the answer isn't accepted. But Method 1 worked for me.
    – misguided
    Apr 26, 2019 at 2:13
  • 2
    You could also make a symlink named pip in your Python installation directory. mklink /D pip .\Lib\site-packages\pip
    – Vince
    Jan 29, 2020 at 9:35
9
  • Open python37._pth file which is in the root folder of python.
  • Add Lib\site-packages line.

All will work fine.

1
  • Thank you. Of all the advice offered for this problem, this is the one thing that actually worked. :)
    – lurker
    Aug 31, 2022 at 17:51
5

The following steps may be followed to install pip on windows:

  1. 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
  2. Go to command prompt and Check your python version: c:> python
  3. From command prompt run: c:> python get-pip.py
  4. The above will install new version of pip. check by running C:> pip --version
  5. You may also update setup tools - C:> pip install --upgrade pip setuptools
5

I suggest referring to the pip homepage: https://pip.pypa.io/en/stable/installation/ It describes all methods on how to install pip. I am a win10 user so the solution was to run this command:

py -m ensurepip --upgrade
3
2
py -m ensurepip --upgrade 

this is work for me official docs link you can try multiple methods based on os. https://pip.pypa.io/en/stable/installation/

0

Use following commands can be used to find out whether pip extraction path is included or not.

>>> import sys
>>> sys.path

if Lib\site-packages path is not included then update file python37._pth.

Run the command again and path should be visible.

pip install <module name> worked successfully for me after this.

Thanks @demianzhang for the hint or even for the solution.

0

I found files in my Windows lib\site-packages directory ~ip ~ip-20-0.2.dist-info

Renamed them to pip pip-20-0.2.dist-info

And it worked to run pip install --upgrade pip

0

If your Python environment does not have pip installed, there are 2 mechanisms to install pip supported directly by pip’s maintainers:

  1. ensurepip

  2. get-pip.py

Method 1

ensurepip Python comes with an ensurepip module1, which can install pip in a Python environment.

  1. Linux: python -m ensurepip --upgrade

  2. MacOc: python -m ensurepip --upgrade

  3. Windows: py -m ensurepip --upgrade

Method 2

get-pip.py This is a Python script that uses some bootstrapping logic to install pip.

Download the script, from https://bootstrap.pypa.io/get-pip.py.

Open a terminal/command prompt, cd to the folder containing the get-pip.py file and run:

  1. Linux: python get-pip.py

  2. MacOc: python get-pip.py

  3. Windows: py get-pip.py

Above installation commands are in official python link.

Optional

After successful installation of pip you might want to upgrade pip to latest version

for Linux and MacOs python -m pip install --upgrade pip

for Windows : py -m pip install --upgrade pip

-1

I solved my problem by opening my shell as admin

1
  • Had the same message erros and it worked, no need to downvote, otherwise post your answer instead or downvote all the answers that didn't work for you
    – Ed_
    Feb 23, 2022 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.