A missing SOCKS dependency is a local Python installation problem. Requests and HTTPX use different optional packages, so install the extra for the client your script imports.

Requests

uv add 'requests[socks]'
uv run python -c 'import requests, socks; print(requests.__version__)'

Requests uses PySocks. With that dependency installed, a socks5h:// proxy URL delegates destination DNS to the SOCKS proxy. The endpoint itself must provide SOCKS service.

HTTPX

uv add 'httpx[socks]'
uv run python -c 'import httpx, socksio; print(httpx.__version__)'

HTTPX uses socksio; installing requests[socks] does not supply HTTPX's extra.

Already installed?

A terminal, IDE, notebook kernel, and scheduled job can use different Python environments. Check the interpreter used to run the failing script:

uv run python -c 'import sys; print(sys.executable)'

Run the import check in that same environment. Once it succeeds, retry the request with a bounded timeout; any subsequent authentication, connection, or SOCKS reply error concerns the connection itself. If you need public endpoints for that next test, browse the SOCKS5 proxy list and keep the client in the matching SOCKS mode.

འབྲེལ་བའི་རྩོམ་ཡིག