How to Install Python Requests on Windows
If you're working with Python, you may need to use the requests library to make HTTP requests. Here's how you can install it on Windows:
Method 1: Using pip
The easiest way to install requests is by using pip, which is a package manager for Python. To install pip, follow these steps:
- Open a command prompt by pressing the Windows key and typing "cmd".
- When the Command Prompt appears in the search results, right-click it and select "Run as administrator".
- Type the following command to install pip:
python -m ensurepip --default-pip
Once you have pip installed, you can use it to install requests:
- Open a command prompt as an administrator again.
- Type the following command:
pip install requests
Method 2: Using Anaconda
If you're using Anaconda, you can install requests using the Anaconda prompt:
- Open the Anaconda prompt from the Start menu.
- Type the following command:
conda install requests
Method 3: Manual Installation
If you prefer not to use pip, you can download and install requests manually:
- Go to the requests website at https://requests.readthedocs.io/en/master/.
- Click on the "Download" button to download the latest version of requests.
- Extract the downloaded zip file to a directory of your choice.
- Open a command prompt in the directory where you extracted requests.
- Type the following command:
python setup.py install
hljs.highlightAll();