2

I ran the Python 3.5.1 installer from https://www.python.org/downloads/release/python-351/. However, on the command line, when I go to run pip, I see an error: 'pip' is not recognized as an internal or external command.

Is there something wrong?

IgorGanapolsky
  • 23,124
  • 17
  • 109
  • 132
  • You might also try upgrading pip with `python -m pip install -U pip` in the command line. – Carson Mar 21 '16 at 16:07
  • @Carson Your suggestion yields an error: `C:\python351\python.exe: No module named pip` – IgorGanapolsky Mar 21 '16 at 16:08
  • That's odd. Usually pip comes with the python installation. What's the output of `python get-pip.py` (again in command line)? – Carson Mar 21 '16 at 16:11
  • @Carson `You're using an outdated location for the get-pip.py script, please use the one available from https://bootstrap.pypa.io/get-pip.py` – IgorGanapolsky Mar 21 '16 at 16:13

2 Answers2

12

The solution is to get the latest pip installer script from: https://bootstrap.pypa.io/get-pip.py, and install it with python get-pip.py.

Then you can use commands like python -m pip ... to your heart's content.

IgorGanapolsky
  • 23,124
  • 17
  • 109
  • 132
6

You must to add pip's path into Environment Variables. Pip is contained in python's script directory.

Example my case: C:\Python34\Scripts\pip.exe

To add path to environment variables.

  1. Hold Win and press Pause.
  2. Click Advanced System Settings.
  3. Click Environment Variables.
  4. Add C:\Python34\Scripts (Sorry I don't know name of python 3.5's directory) to the Path on System variables.
  5. Restart Command Prompt.

Edit

In another way, you can use pip-Win instead of pip. Read more here: https://sites.google.com/site/pydatalog/python/pip-for-windows

chin8628
  • 385
  • 5
  • 14
  • 1
    This is not true for Python 3. It is not necessary to add pip's path to env variable, unless you need to access `pip` from any other directory. I do not even have a `Scripts` directory in my Python folder. – IgorGanapolsky Mar 21 '16 at 18:50
  • Works for python3.8 on Windows 10 installed by Choco. Pip always seems to be in the script folder. – Timo Jul 08 '20 at 15:13