How to Install urllib3 in Python
HTTP library with thread-safe connection pooling, file post, and more.
pip install urllib3
What is urllib3?
HTTP library with thread-safe connection pooling, file post, and more.
urllib3 is a powerful, user-friendly HTTP client for Python. urllib3 brings many critical features that are missing from the Python standard libraries:
- Thread safety. - Connection pooling. - Client-side SSL/TLS verification. - File uploads with multipart encoding. - Helpers for retrying requests and dealing with HTTP redirects. - Support for gzip, deflate, brotli, and zstd encoding. - Proxy support for HTTP and SOCKS. - 100% test coverage.
... and many more features, but most importantly: Our maintainers have a 15+ year track record of maintaining urllib3 with the highest code standards and attention to security and safety.
Quick Start
Minimal example to get started with urllib3:
import urllib3
print(urllib3.__version__)
Installation
pip (standard)
pip install urllib3
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install urllib3
pip3
pip3 install urllib3
conda
conda install -c conda-forge urllib3
Poetry
poetry add urllib3
Verify the Installation
After installing, confirm the package is available:
python -c "import urllib3; print(urllib3.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing urllib3 with pip.
ModuleNotFoundError: No module named 'urllib3'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install urllib3. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'urllib3' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install urllib3 to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'urllib3'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show urllib3 and upgrade with pip install --upgrade urllib3.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install urllib3. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user urllib3
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org urllib3
ConnectionError: Failed to establish a new connection
Cause: Server unreachable, URL invalid, or firewall/proxy blocking the connection.
Fix: Verify the URL and network access. Set HTTP_PROXY / HTTPS_PROXY env vars if behind a proxy.
SSLError: CERTIFICATE_VERIFY_FAILED
Cause: The remote server's SSL certificate cannot be verified.
Fix: Update CA certificates on your system. For testing only, disable SSL verification (never in production).
Recent Releases
| Version | Released |
|---|---|
2.6.3 latest |
2026-01-07 |
2.6.2 |
2025-12-11 |
2.6.1 |
2025-12-08 |
2.6.0 |
2025-12-05 |
2.5.0 |
2025-06-18 |
Manage urllib3
Upgrade to latest version
pip install --upgrade urllib3
Install a specific version
pip install urllib3==2.6.3
Uninstall
pip uninstall urllib3
Check what is installed
pip show urllib3