Last Updated : 12 Jul, 2025
Requests is an elegant and simple HTTP library for Python, built for human beings. One of the most famous libraries for Python is used by developers all over the world. This article revolves around how one can install the requests library of Python in Windows/ Linux/ macOS using pip.
Install Requests Module in Python in WindowFor installing requests in Windows, you need to Install Python (preferably the latest version) first, follow these simple steps to Install Python on Windows:
Steps to Install Python 3 on Windowspython-3.x.x.exe
) and run it.pip
, tcl/tk
, and documentation.Note: You may also refer to this article to get the in-depth details - How to download and install Python Latest Version on Windows
Now open the command prompt from Windows and run the following command:
python -m pip install requests
Booom..!! Done Now this is how you can install Requests Module using pip.
Install Requests Module in Python in LinuxFor installing requests in Linux, you need to Install Python (preferably the latest version) first, follow these simple steps to Install Python on Linux:
Steps to Install Python 3 on LinuxNote: If you want to check if Python is already installed in your system then you may run this command in terminal: python --version (This will display the current running version of Python in your Linux)
Install Requests Module in Python in MacOSNote: Alternatively, you may visit this article to read on Installation Guide:
How to download and install Python Latest Version on Linux
To install pip in linux: How to install PIP in Linux?
For installing requests in MacOS, you need to Install Python (preferably the latest version) first, follow these simple steps to Install Python on macos:
.pkg
file (e.g., python-3.x.x-macosx.pkg
).Alternative MethodsNote: Alternatively, you may visit this article to read on Installation Guide:
Install Python Latest Version on MacOS
To install pip macOS. Run the following command
sudo easy_install pip sudo pip install --upgrade pipNow to install requests,
pip install requests
The last method for installation of requests on any operating system is to grab the base files and install requests manually and Requests is actively developed on GitHub, where the code is always available. For code -
You can either clone the public repository:
git clone git://github.com/psf/requests.git
Or, download the tarball:
curl -OL https://codeload.github.com/psf/requests/legacy.tar.gz/main # optionally, zipball is also available (for Windows users).
Once you have a copy of the source, you can embed it in your own Python package, or install it into your site-packages easily:
cd requests pip install .Troubleshooting Tips
While installing Requests, you might encounter some issues. Here are a few troubleshooting tips for different operating systems:
pip: command not found
"
or "pip is not recognized
"
, make sure Python and pip are added to your PATH environment variable.Permission Denied
error, try running the installation with sudo
(Linux/macOS):
sudo pip3 install requests
pip install --upgrade pip
pip
(e.g., pip3
for Python 3).Installing the Requests library in Python is straightforward on Windows, Linux, and macOS. If you're looking to manage HTTP requests or interact with APIs, the Requests library is an essential tool for your Python projects.
By following the steps outlined in this guide, you can easily set up Requests on any major operating system. Make sure you’re using the latest versions of Python and pip to ensure compatibility with the latest updates to Requests.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4