Easy Guide: Installing the Requests Library for Python on Windows

Feb 3, 2024 ยท 2 min read

The Python requests library is an essential tool for making HTTP requests in Python. Whether you're building web scrapers, APIs, or other projects that interact with the internet, requests makes sending and receiving data easy.

In this guide, I'll walk you through how to install requests using pip on Windows. We'll go step-by-step so you can get up and running with this useful library quickly.

Prerequisites

Before installing requests, make sure you have Python and pip already installed on your Windows machine. The latest versions of Python come with pip by default.

To check if you have pip, open a command prompt and type:

pip --version

If you get a version number, you're good to go! If not, you'll need to install pip first before proceeding.

Install Requests

With Python and pip ready, installing requests is simple.

Open a command prompt and run:

pip install requests

Pip will download the latest requests package and dependencies and set everything up automatically.

Once it finishes, requests is installed and ready to import in your Python scripts!

To confirm, open a Python shell and try:

import requests
print(requests.__version__)

This should print out your installed requests version without any errors.

And that's it! With just a quick pip command, you now have requests installed locally on your Windows machine.

Next Steps

From here you can start using requests to make HTTP requests in your Python projects:

  • Build a web scraper to extract data
  • Interact with REST APIs like Twitter, GitHub, etc.
  • Automate workflows that rely on internet services
  • Test web hooks and other HTTP-based integrations
  • So give requests a try in your next Python script to supercharge your web-based programming!

    Browse by tags:

    Browse by language:

    The easiest way to do Web Scraping

    Get HTML from any page with a simple API call. We handle proxy rotation, browser identities, automatic retries, CAPTCHAs, JavaScript rendering, etc automatically for you


    Try ProxiesAPI for free

    curl "http://api.proxiesapi.com/?key=API_KEY&url=https://example.com"

    <!doctype html>
    <html>
    <head>
        <title>Example Domain</title>
        <meta charset="utf-8" />
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
    ...

    X

    Don't leave just yet!

    Enter your email below to claim your free API key: