Need help with Python 2.7 Extended Lifecycle Support?

Learn More

Install Requests 2.26.0

ActiveState has made it easy to install the latest version of Requests. Copy and paste the snippet below into your terminal to install a verified, built-from-source version of Requests from ActiveState's free repository. We've taken care of all the dependencies so you don't have to.

Requests Logo

Run the following command in your terminal

pip3 install --index-url https://har.activestate.com/activestate/trusted-artifacts/latest requests==2.26.0

The --index-url parameter tells pip to install the package from ActiveState's repository.

Built for

  • OSX
  • Linux
  • Windows

Compatible with

Compatible with 3.7, 3.8 & 3.9

Why install Python packages from ActiveState?

ActiveStatePyPIAnaconda
/ conda

Built from source code

We build all packages from known and vetted source code. The source code is stored indefinitely on our secure supply chain. This reduces the likelihood of specific types of exploits while eliminating typosquatting.

VariesVaries

Support for OS-level dependencies

Artifact dependencies extend to the operating-system level. For example, when building XML libraries for Python, we also build Expat from its C source files.

Vetted new source releases

Source is updated as new versions are released, but after a manual and automatic review process and at 24-48 hour delay compared to the main public repository.

Varies

Artifacts built for Linux, MacOS, Windows

Isolated and ephemeral build environments

Build stages are conducted in single-use build environments that are discarded after the build is complete. Builds are run automatically based on known and version-controlled configurations.

Varies

Revision-controlled build history

The ActiveState Platform maintains a catalog of all source code used to build artifacts, along with all available metadata. This information is revision-controlled and immutable (except when a change is essential for security or privacy reasons).

Varies

Machine-readable SBOM

We store all provenance metadata available for all artifacts, exposing it as machine-readable SBOM files.

Supply chain levels for Software Artifacts (SLSA) Level 4

SLSA is led by an initial cross-organization, vendor-neutral steering group committed to improving the security ecosystem for everyone. SLSA Level 4 requires two-person review of all changes and a hermetic, reproducible build process.

Get these features and more with the ActiveState Platform.

Our enterprise-grade platform can help streamline your Python, Perl & Tcl workflows.

Create a free account

97% of the Fortune 1000 companies use ActiveState

For more than 20 years, ActiveState has been making open source easier, more secure, and less risky.

Cisco Logo
Tesco Logo
NASA Logo
Verizon Logo
Texas Instruments Logo
Toyota Logo
Capital One Logo
Siemens Logo

Frequently Asked Questions

What is Requests?

Requests is known as “http for human beings” since it is the de facto library for making HTTP requests in Python. It abstracts the complexities of making requests behind a simple API so that you can focus on interacting with services and consuming data in your application.

Which Python versions are compatible with Requests?

Requests is compatible with Python 2 (Python 2.7 and later), as well as Python 3 (Python 3.6 and later).

What dependencies does Requests have?

Requests has the following dependencies, which will be installed automatically when installing Requests.

  • certifi
  • charset-normalizer
  • idna
  • urllib3
How do you install Requests globally and in a virtual environment?
Installing Requests Globally

Copy (either ctrl+c or just click the “copy” button) and paste the snippet at the top of this page into your command line. As with all Python packages installed with Python’s default package manager, pip, Requests will be installed to %PYTHONHOME%/site-packages.

Installing Requests in a Virtual Environment

You can also work in a virtual environment to prevent conflicts. You can use pip to install a specific version of the Requests package into a virtual environment  for Python 3 projects with the following command:

python
python3 -m venv <path_to_env>

venv will create a virtual Python installation in the <env_name> folder.

Activate <env_name> with the following command:

On Linux

python
source <env_name>/bin/activate

On Windows

You can pip install Flask into your virtual environment with the following command:

python
python -m pip install requests

Where does Requests install to?

As with all Python packages installed with pip, requests will be installed to %PYTHONHOME%/site-packages. This will install requests globally. However, we always recommend installing into a virtual environment (like virtualenv).

Does Requests work on Windows, Linux and Mac?

Yes, requests will work Windows, Mac, and Linux (Ubuntu, CentOS, RHEL, etc.).

How is Requests commonly used?

Requests is a popular open source HTTP library that simplifies working with HTTP requests, supports basic authentication as well as SHA-256 and SHA-512 digest auth algorithms, and makes creating custom headers easy.

The requests Python library is available for both Python 2 and Python 3 from the Python Package Index (PyPI), and has the following features:

  • Allows you to send HTTP/1.1 PUT, DELETE, HEAD, GET and OPTIONS requests with ease. For example:

import requests

req = requests.request('GET', 'https://httpbin.org/get')

Req

# Output:

<Response [200]>

  • You can use it to send form-encoded data, similar to an HTML form.
  • Provides a demystified, readable API for humans. For example, this is how you make an HTTP POST request:

r = requests.post('https://httpbin.org/post', data = {'key':'value'})”

Prior to the availability of the requests library, it was necessary to manually add query strings to URLs, and form-encode PUT & POST data. Now you can use requests with the JSON method instead.

Read the docs.