Registry / http-networking / pyqwest

pyqwest

JSON →
library0.6.1pypypi✓ verified 87d ago

PyQwest is a modern Python HTTP client built on the high-performance Rust library `reqwest`. It offers support for advanced HTTP features, including bidirectional streaming, HTTP/2, and HTTP/3. It provides both asynchronous and synchronous client interfaces and aims for a fully-typed, Pythonic API. The current version is 0.4.1. Releases are made on an as-needed basis, often to incorporate updates from the underlying `reqwest` library or to add new features.

pip install pyqwest
INSTALL
IMPORT
SIG · PYQWEST
P
pyqwest
http-networkingpythonv0.6.1
Install
1.9s avg
Import
17ms
Disk
31MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 1.9s
py 3.11
✓ —
✓ 1.95s
py 3.12
✓ —
✓ 1.75s
py 3.13
✓ —
✓ 1.83s
py 3.9
✕ build_error
✕ build_error
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from pyqwest import Client
For asynchronous HTTP requests.
SyncClient
from pyqwest import SyncClient
For synchronous HTTP requests.
PyQwestTransport
from pyqwest.httpx import PyQwestTransport
To use PyQwest as a synchronous transport for HTTPX clients.
AsyncPyQwestTransport
from pyqwest.httpx import AsyncPyQwestTransport
To use PyQwest as an asynchronous transport for HTTPX clients.

This quickstart demonstrates basic GET requests using both the asynchronous `Client` and synchronous `SyncClient`.

import asyncio from pyqwest import Client, SyncClient async def async_example(): client = Client() response = await client.get("https://httpbin.org/get") print(f"Async Response Status: {response.status}") print(f"Async Response Body Length: {len(await response.content())}") def sync_example(): client = SyncClient() response = client.get("https://httpbin.org/get") print(f"Sync Response Status: {response.status}") print(f"Sync Response Body Length: {len(response.content())}") if __name__ == "__main__": print("Running async example...") asyncio.run(async_example()) print("\nRunning sync example...") sync_example()
Debug
Known issues
gotchaPyQwest is a Rust-based library. If pre-built wheels are not available for your specific platform and Python version, you will need the Rust toolchain installed for `pip` to build it from source.
fix
Ensure Rust is installed (e.g., via `rustup`) before attempting to `pip install pyqwest` if pre-built wheels are not provided for your environment.
affects: All
breakingIf you were previously passing custom `httpx.AsyncClient` or `httpx.Client` sessions directly to clients that now internally use `pyqwest` (e.g., `connect-python` v0.8.0+), you will need to migrate to passing `pyqwest.HTTPTransport` or `pyqwest.SyncHTTPTransport` instances, or a `pyqwest.Client`/`pyqwest.SyncClient` directly.
fix
Consult the documentation of the integrating library. For `connect-python` specifically, replace `httpx.AsyncClient` with `pyqwest.HTTPTransport` or `pyqwest.Client` as per their migration guide.
affects: 0.1.0 and later when integrating with other libraries that adopt PyQwest as their HTTP transport.
gotchaThe `pyqwest` library is distinct from `pyreqwest`. While both are Python HTTP clients based on the Rust `reqwest` library, they are separate projects with different APIs and development teams. Ensure you are importing and using the correct library.
fix
Verify your `pip install` commands and import statements to ensure you are consistently using `pyqwest`.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyqwest'
The 'pyqwest' package is not installed in the current Python environment.
fix
pip install pyqwest
AttributeError: module 'pyqwest' has no attribute 'get'
The 'get' method is called directly on the 'pyqwest' module instead of on an instance of 'pyqwest.Client' or 'pyqwest.AsyncClient'.
fix
import pyqwest

client = pyqwest.Client()
response = client.get('http://example.com')
print(response.status_code)
AttributeError: 'coroutine' object has no attribute 'status_code'
An asynchronous method (e.g., 'AsyncClient.get()') was called without 'await', resulting in a coroutine object instead of the actual 'Response' object.
fix
import asyncio
import pyqwest

async def main():
    async with pyqwest.AsyncClient() as client:
        response = await client.get('http://example.com')
        print(response.status_code)

if __name__ == '__main__':
    asyncio.run(main())
ERROR: Failed building wheel for pyqwest
The Rust toolchain (required to compile the underlying reqwest library) is not installed or configured correctly on the system.
fix
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
pip install pyqwest
ImportError: cannot import name 'client' from 'pyqwest'
The main HTTP client class in pyqwest is named `QwestClient` (with a capital 'Q'), not `client`.
fix
from pyqwest import QwestClient
Upgrade
Version history
0.6.1latest on PyPI · released Jun 3, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
Resources
pyqwest — pip install pyqwest · libregistry