12

I recently downloaded and installed Python 3.9 because I wanted to run a website scraper to more easily organize recipes found online. However, when I try to run pip it says it doesn't recognize it (and I have tried editing the path but every video or site I find has different information).

Even a basic check of my Python version comes back with no results:

enter image description here

I have uninstalled and reinstalled Python 3.9 but to no avail. There is also no scripts file within my python file and my computer doesn't even seem to recognise that Python is installed.

alex
  • 6,818
  • 9
  • 52
  • 103
smarotu
  • 121
  • 1
  • 1
  • 3
  • Try this? https://stackoverflow.com/a/13596981/14510424. My guess is you might have 2 versions of python installed and it doesn't know which to use? – Alfie Hanks Oct 24 '20 at 07:39
  • Also did you tick these boxes on install? https://stackoverflow.com/a/54029728/14510424 – Alfie Hanks Oct 24 '20 at 07:41
  • 1
    please add the python path to environment variables – Umair Mubeen Oct 24 '20 at 07:41
  • Does this answer your question? [Python not working in command prompt?](https://stackoverflow.com/questions/13596505/python-not-working-in-command-prompt) – BeeFriedman Oct 25 '20 at 05:38
  • I was having the same problem @smarotu, and for me uninstalling python and reinstalling it with add to PATH option checked, worked. – typedecker Sep 16 '21 at 11:29

8 Answers8

7

In python 3.9 you can add below path(scripts path) to your environment variable

C:\Users\ASUS\AppData\Local\Programs\Python\Python39\Scripts

Once the path is added, open a fresh CMD window and type pip --version.

You can see your pip version pip 20.2.4

Shubham Khunt
  • 271
  • 4
  • 6
5

I found that for Python 3.9 if you enter the command as py -m pip install, the installation initiates as expected.

Annotation 2021-06-17 121518_install pywinauto Visual Studio Code terminal

OwnDevise
  • 5
  • 3
L00ti
  • 51
  • 1
  • 2
1

I finally can use pip install. Here is how I do it:

  1. Run python 3.6.9-adm64.exe

  2. Choose Modify

  3. Tick all boxes and click Next

  4. Tick [Create shortcuts...appplication](not important) and Add Python to environment variables and click Install

  5. Now run CMD and type:

    py -m pip install (name) //pygame for example
    

Now I installed pygame easily.

m4n0
  • 29,823
  • 27
  • 76
  • 89
Bob
  • 11
  • 1
1

On my windows laptop, python 3.9 was installed with the installer from python.org. I do not remember which options were checked but pip does not seem to be available in the Scripts folder.

> where python
C:\Python39\python.exe

> where pip
Information : impossible de trouver des fichiers pour le(s) modèle(s) spécifié(s).

> python -m pip --version
C:\Python39\python.exe: No module named pip

The following steps worked:

> python -m ensurepip
Looking in links: c:\Users\<user>\AppData\Local\Temp\tmprd5o7bcb
Processing c:\users\<user>\appdata\local\temp\tmprd5o7bcb\setuptools-56.0.0-py3-none-any.whl
Processing c:\users\<user>\appdata\local\temp\tmprd5o7bcb\pip-21.1.3-py3-none-any.whl
Installing collected packages: setuptools, pip
Successfully installed pip-21.1.3 setuptools-56.0.0

> python -m pip --version
pip 21.1.3 from C:\Python39\lib\site-packages\pip (python 3.9)

> pip3 --version
pip 21.1.3 from c:\python39\lib\site-packages\pip (python 3.9)

Note that the pip alias does not seem to be installed by ensurepip, so I need to use pip3 instead.

smarie
  • 4,568
  • 24
  • 39
0

I have fixed this issue by running apt-get install python3-pip on my Debian Linux.

Striezel
  • 3,693
  • 7
  • 23
  • 37
kip
  • 17
  • 2
0

every video or site I find has different information

This may be due to the fact that those sites provide information for different Python versions.

As Alfie Hanks already pointed out in the comments: The right way to do it is to check the box Add Python 3.x to PATH when installing Python 3 for the first time. When re-running the installer / re-installing choose "Modify" and check the box Add Python to environment variables. That takes care of setting the correct environment variable so that the Python and pip binary can be found by Windows.

If you have trouble finding those options, take a look at circlepi314's answer to a similar Python question: https://stackoverflow.com/a/54029728/6710751 This one has screenshots of the installer where those options are marked.

Striezel
  • 3,693
  • 7
  • 23
  • 37
-1

Install python again and when the prompt window opens, click on the modify button. Then check if pip is checked. If not then check it and then proceed with the install.enter image description here

If it still doesn't work, simply uninstall python. And then when you reinstall it make sure that the ADD to path checkbox is checked.

Vishnu S
  • 47
  • 3
-3

I had the similar problem, I managed to solve it with the following:

I installed python 3.9 by Brew on my Mac, so the pip3 was broken

I resolved by uninstalling python3.9 and installing 3.8