Pip is a Python command through which you can install, upgrade, or uninstall various python packages that you want to use in your code.
The ‘pip command not found’ error message appears when you use the pip command without having the pip installed in your system.
In this article, you will find four fixes to solve the issue of the ‘pip command not found’ error.
Also read: How to install Python in Windows?
Reinstall Python
You can reinstall python in your system and while reinstalling python, follow the given steps;
Step 1: Checkmark the Add Python 3.10 to PATH check box, and click on Customize Installation.
Step 2: In the optional features dialogue box, checkmark the Pip checkbox and click on Next.
Step 3: Checkmark the Add Python to environment variables and click on Install.
When your installation is complete, you will have the pip command installed in your system and added to the environment variables.
Check the python version
Check the Python version installed in your system using the following command.
python --version
The command ‘pip’ works for Python 2. However, for Python 3, ‘pip3’ is the command and not ‘pip’. This can also be the reason why you are getting the ‘pip command not found’ error.
pip3 install utils
Install pip through a command
To install pip through the command line, follow the steps given below.
Step 1: Download the get-pip.py file by running the following command in the command prompt.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Step 2: Run the following command to install pip.
python get-pip.py
After pip is installed in your system, add its path to the environment variables by following the steps given next.
Add pip to the path in environment variables
Add your Pip in the path in environment variables. To do so, follow the steps given.
Step 1: Open your file explorer and go inside ‘C:\Users\user\AppData\Local\Programs\Python\Python38\Scripts’, and check if you have pip3.exe file over there. Copy the path.
C:\Users\user\AppData\Local\Programs\Python\Python38\Scripts
NOTE: In the path ‘C:\Users\user\AppData\Local\Programs\Python\Python38\Scripts’, the name of the Python38 folder may vary according to your Python version. For example, it can be Python36 if your python version is 3.6.
Step 2: Click on the Windows icon and search for Environment Variables. Open it.
Step 3: In the system properties dialogue box, click on Environment Variables.
Step 4: Inside the User variables for user, find the PATH variable and click ‘edit‘.
Step 5: Click on New and add the copied path in the new block, and hit ok.
Now, pip is added to your environment variables; you can open the command prompt and try running the ‘pip3’ command. It should show you a similar output as shown below.
Also read: How to install pip in Ubuntu?