5

I have checked that I have python 3.8 installed on my windows10 machine. I'm trying to install a package with pip but the terminal tells me '[pip' is not recognized as an internal or external command, operable program or batch file.]

I understand that Python versions above 3.4 have pip pre-installed, so why am I getting this error message?

This is what I mean

Zaham2
  • 337
  • 1
  • 4
  • 11
  • 1
    Can you cd into the directory where you installed Python, cd into the Scripts folder and try running pip? If you can run pip from there it likely means the pip command is not in your PATH environment variable. – Jon Behnken Dec 08 '19 at 22:50
  • You must install pip: Download the https://bootstrap.pypa.io/get-pip.py script and then install it by running `python get-pip.py` – eyllanesc Dec 08 '19 at 22:51
  • Try this: install pip by typing the line in terminal or cmd `curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py` then type `python get-pip.py`. After this do `pip install --upgrade pip` that will solve your problem – Shantanu Deshmukh Dec 08 '19 at 23:21
  • @J.Behnken That was exactly the problem... I added it and everything works fine now – Zaham2 Dec 09 '19 at 08:42

2 Answers2

9

Try accessing pip in the following way:

python -m pip --version
Jadon Manilall
  • 607
  • 6
  • 7
  • 2
    This worked and tells me that I have pip v 19.2.3 . But how do I avoid this issue and use pip directly? – Zaham2 Dec 08 '19 at 22:57
  • 1
    I tried this but i got `SyntaxError: invalid syntax` – ExHunter Apr 10 '20 at 10:29
  • Can you install pip this way? `python -m pip install --upgrade pip` – Åsmund Jul 30 '20 at 08:18
  • @ExHunter this is probably because of your python3 version is `3.5.2` but `fstring` is introduced from `python3.6` (https://docs.python.org/3.6/whatsnew/3.6.html) and hence, it is not identified by your current python version. – hafiz031 Mar 02 '21 at 06:38
2

You should install pip first.

  1. Download get-pip.py from there
  2. Install via executing python <path to get-pip.py> in cmd.
  • Here you can read more [here](https://github.com/BurntSushi/nfldb/wiki/Python-&-pip-Windows-installation#pip-install). – Dmitry Kulazhenko Dec 08 '19 at 22:53
  • I did come across this article. Doesn't pre-installed mean that I don't have to manually install it? – Zaham2 Dec 08 '19 at 22:58
  • @Zaham2, pip is sometimes included automatically when python is installed to your system, and sometimes you have to install it yourself. Also, on windows, sometimes needed to add some paths to PATH environment variable. – Dmitry Kulazhenko Dec 09 '19 at 10:20
  • Also this duplicates https://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows – Dmitry Kulazhenko Dec 09 '19 at 10:22
  • I don't believe it does. Mine was just a path issue, that's it – Zaham2 Dec 09 '19 at 10:48