Fixing pip not recognized Error Downloading Requests Module on Windows 10 using pip3
If you are trying to install the requests module using the command prompt with pip3 but keep getting a syntax error with pip not recognized, this article will guide you through the process of resolving this issue.
Understanding pip and its versions
pip is the package installer for Python, and it is used to install and manage packages from the Python Package Index (PyPI). pip can be installed as a standalone command-line tool, or it can be included as part of a Python distribution. There are two versions of pip, pip2 (for Python 2) and pip3 (for Python 3).
Checking if pip is installed
To verify if pip is installed, open the command prompt and type pip --version or pip3 --version followed by the Enter key. If pip is installed, the version number will be displayed, as shown below:
C:\Users\TEST>pip3 --version
pip 21.2.4 from c:\python39\lib\site-packages\pip (python 3.9)Resolving the pip not recognized error
The pip not recognized error can occur for several reasons, including:
- pip not being installed on your system
- pip not being added to the system path
- pip not being associated with the Python version you are using
Installing pip
To install pip, download the get-pip.py script from the official pip documentation and run it using the command prompt, as follows:
C:\Users\TEST>python get-pip.pyThis command will install pip and add it to the system path.
Adding pip to the system path
To add pip to the system path, follow these steps:
- Open the start menu and search for "Environment Variables"
- Click on "Edit the system environment variables"
- Click on the "Environment Variables" button
- Scroll down and click on the "Path" variable
- Click on the "Edit" button
- Click on the "New" button
- Add the path to the Python installation folder (e.g.
C:\Python39) - Click "OK" on all the open windows
Associating pip with the correct Python version
To associate pip with the correct Python version, follow these steps:
- Open the command prompt and type
python --version - Verify that the correct Python version is displayed
- If the wrong Python version is displayed, use the
pycommand to switch to the correct version - Once the correct Python version is active, install the
requestsmodule usingpip3 install requests
In conclusion, the pip not recognized error can occur for various reasons, and it can be resolved by installing pip, adding it to the system path, or associating it with the correct Python version. By following the steps outlined in this article, you will be able to install the requests module using pip3 on Windows 10 without encountering the pip not recognized error.
References
- official pip documentation: https