3

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
  • 26,189
  • 23
  • 116
  • 147
  • 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
  • FTR, same in 2023: fresh install (3.10.11 stable) to a custom dir (where all my dev tools live), "pip" is checked in the installer, but in the end, no `pip.*` in the install dir. (`Scripts` is empty.) Mmm... wot??? – Sz. Jun 03 '23 at 15:52

2 Answers2

14

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
  • 26,189
  • 23
  • 116
  • 147
  • 1
    Thanks! Now the only question is wtf is the "pip" checkbox there in the installer then, apparently doing nothing? I mean it's not just frustrating, it's incomprehensible: it's like the most mainstream piece of software ever: P3 install on Windows is done a million times every second today, how can this most frequent, basic, vanilla use case fail at all (and Google knowing nothing much about it, landing here, on this very page)? It's a fascinating mystery to me, seriously. :) – Sz. Jun 03 '23 at 16:00
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
  • 446
  • 7
  • 15
  • 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