[Solved] Pip is not recognized as an internal or external command operable program or batch file.

In this post, I am going to guide you on how to solve this error and what the major reasons behind this error are. So let us first look into the reasons for getting this error before solving the error.

First, open the Windows PowerShell by right-clicking on the windows start button and then click on the “Windows PowerShell” or open the command prompt by using the “Windows+ R” or by typing “cmd” in the Run dialog box. Now the command prompt/Windows PowerShell will open.

The Error:  

I know you are trying to install a package like I install the package "pandas" by typing the command below:

pip install pandas

and you are encountering the following error:

The term ‘pip’ is not recognized as the name of cmdlet, function, or operable program.

This error means simply is that your command prompt is unable to find the pip. Now that we know the root cause of this error, let us fix this

Solution:

Step1:- To solve for this error, first close your command prompt/ Powershell and go to the directory where you have installed your python.

If you are unable to find your python installation directory then a very naive and simple solution is to uninstall your python and install it again to a folder where you can get to its contents easily. You can run a fresh Python installation in the program files folder or simply in your C:// drive (Not required if you found where python is installed).

Step 2:- After finding your python directory go to your PC settings by right-clicking on “This PC” then click on settings.

Step 3:- Go to “Advanced System Settings” A dialog box with the name “System properties” will appear.

Step 4:- Go to “Environment variables” in the bottom right corner of the dialog box.

Step 5:- Go to “User variables” and select “Path”.

Step 6:- Click on the “Edit” button. An “Edit environment variable” window will open.

Click on the “New” button.

Step 7:- Go to the directory where you have installed your python. Go to “Scripts” and copy the path of this folder and paste it in the “New” tab that you have opened in step 6 as shown in the screenshots below:

Step 8:- Now copy your python folder path by following the similar instructions in steps 6 and 7 and paste it to the “Edit Environment Variable” window as shown in the screenshots below:

We have added two more paths in the “User variable path”.

Step 9:-Click on the “Ok” button to close the dialog boxes.

 

Step 10:- Now open “Windows PowerShell” or “Command prompt” and type the following command. (Make sure if you already had PowerShell opened you will have to reopen it. This is really very important)

pip install pandas

Make sure you are connected to the internet. You can see that your problem has been solved now.

I hope you will like this post.

You can still watch this video to get rid of this error if any of the above-mentioned steps are unclear. I am 100% sure that you will able to solve this error after following the instructions given in this article. Happy coding!