For a Requests program launched by PyCharm, edit the Python run/debug configuration that starts it. Add the supported proxy variables in that configuration’s Environment variables field:

NameExample value
http_proxyhttp://proxy.example.net:8080
https_proxyhttp://proxy.example.net:8080

Launch the program again through that configuration. Requests can read these variables with its normal environment integration; no PyCharm-specific proxy argument is needed in requests.get. Use your HTTP service for the example values, or an endpoint from the HTTP proxy list for permitted public requests.

PyCharm’s own HTTP Proxy preference configures IDE networking. It does not by itself prove that the Python child process received the same route.

The terminal, Python console, test runner and saved application configurations can have different launch environments. Compare the one actually used by the failing request. An export entered later in a terminal cannot modify an IDE process that is already running.

If the code sets session.trust_env=False, Requests ignores this environment route. Use its explicit proxy configuration in that deliberate mode.

Tënë sô zo