Is Requests a Built-In Python Library?
The requests library is not part of the Python standard library and does not ship with a standard Python install. It is a third-party package distributed on PyPI, so you install it before you can import it. This guide covers the install command, the Python version requirement, and a minimal first request.
Built-in vs. third-party: a quick classification
A module is built-in when it is available in a fresh Python installation without any extra install step — for example, modules that ship with the standard library. Requests does not meet that test. It is maintained as a separate project and published on PyPI, which means a fresh interpreter cannot import it until you add it.
A short checklist to classify any module:
- Does
import <module>succeed in a clean virtual environment with no extra installs? If yes, it is likely built-in or part of the standard library. - Does the project appear on PyPI with its own release history? If yes, it is third-party.
- Does your project's dependency file need to list it? If yes, it is third-party.
Requests falls into the third-party category on all three checks.
Install requests with pip
Install the package before importing it. The command below uses the interpreter-bound form of pip, which keeps the install in the same environment as the Python you will run:
Command example
python -m pip install requestsPython version requirement
Requests currently requires Python 3.10 or newer. If your interpreter is older, the install or import can fail; upgrade Python or use a supported environment before continuing.
Your first GET request
After installation, import the library and send an HTTP GET request. The example below sets a 10-second timeout and prints the response status code. Setting a timeout matters: without one, a slow or unreachable host can leave your script waiting indefinitely.
Field map for the sample call:
- URL argument — the address you are requesting; the example uses a placeholder base URL.
timeout=10— the maximum wait, in seconds, before the request raises a timeout error.response.status_code— the numeric HTTP status returned by the server; a successful request typically returns 200.
The captured terminal output shows a status code of 200 for this request.
What happens if you skip the install
If you try to import requests before installing it, Python raises a ModuleNotFoundError because the module is not present in the environment. This is the practical difference between a built-in library and a third-party one: the import fails until the package is installed. Running the pip command from the same environment that will execute your script resolves it.
Where to read more
The project's official documentation and its GitHub repository are the primary references for the library's API and release notes. For related troubleshooting topics — SSL errors, connection timeouts, schema errors, redirect limits, and whether requests is deprecated — see the linked question pages in the related section.
Frequently asked questions
Is requests included when I install Python?
No. A standard Python installation does not include requests. It is a separate third-party package published on PyPI, so you must install it with pip before importing it.
Which Python version does requests need?
Requests currently requires Python 3.10 or newer. Check your interpreter version before installing if you are on an older release.
Why does import requests fail with ModuleNotFoundError?
That error means the package is not installed in the environment running your script. Install it with pip using the same interpreter, then import again.
Should I set a timeout on requests calls?
Yes. The example sets timeout=10 so a slow or unresponsive server cannot block the script indefinitely. Without a timeout, the call can wait much longer than expected.