Fixing ‘pip’ is not recognized in Python with PySide

‘pip’ is not recognized in Python is an error which occurs when the pip.exe path is not in the system PATH variable.

In the blog post I attempt to explain why this error takes place and how you can solve it, I will also add other solutions that could solve the error if possible.

Exploring the Error : ‘pip’ is not recognized in Python

pip is not recognized in Python is an error which occurs when the pip.exe path is not in the system PATH variable.

Please double check so you can avoid mixing between different errors. The error message should look like the error message bellow.

                                                                       #
The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program.
                                                                       #

Bellow we will take care of the error using multiple possible solutions according to your needs.

Solution 1 : use the cd command before using pip in order to change the directory to where pip.exe is loacated

In most cases, the root of the problem is that the path of pip.exe is not in the system PATH variable. That is exactly why the command prompt does not know where pip is located.

I think the solution is clear, the first fix is to use the cd command to change the directory in then run pip.

So, in your command prompt, change the directory to where pip is located using the command bellow.

                                                                       #
cd C:\PythonAA\Scripts
# pythonAA should be replaced with your python version. For example if you have python 3.5 the command should be cd C:\Python35\Scripts. If you have python 3.8 the command should be 
cd C:\Python38\Scripts. I think you understand what I mean.
                                                                       #

After the command above you should just use pip as usual to install a package for example etc. The error should be gone.

Solution 2 : Manually add your python scripts file to your PATH variable

The second method to get rid of this error is to add the python scripts file to your PATH variable.

The python scripts file is the path where you chose to install python and then you add /scripts since this is the directory or folder we are looking for.

This is how the path looks like in my machine.

                                                                       #
C:\Users\achnac\AppData\Local\Programs\Python\Python38-38\Scripts
                                                                       #

For you, just navigate to C:\Users\achnac\AppData\Local\Programs and find the scripts folder.

First, you should start by closing your command prompt, this is very important.

Navigate to the windows search bar and past system variables.

You will see an icon with the same phrase. Click on it.

At the bottom, click on the environment variables button.

Look for path and click edit. Paste the path to the directory we have just copied. Save and then close the windows.

Now, run your code and everything should be fine.

Solution 3 : use a command to add your python scripts file to your PATH variable

Instead of using the manual method above, you can use only the command prompt.

First, you should start by closing your command prompt.

Open the command prompt as admin. Then run the command bellow.

                                                                       #
setx path "%PATH%;C:\Python38\Scripts;"
# this is if have python 3.8. If you have python 3.7 or 3.5 or any other version, just edit the command so that it points to your version
                                                                       #

Now, the path should be added to the path variable, everything should work just fine.

The solutions above should be enough to solve the problem, if you like our effort make sure to consider donating to our Kofi account, there is a red button that you can use if you are feeling generous.

Summing-up : 

This article is over guys, the error pip is not recognized in Python should be gone.

You can support us by donating to our Kofi account, you can find a red button at the top of this page. Good luck with your Python journey, keep coding, cheers.

If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/