PyCharm cannot access Proxy

  • 3
  • 6

I have a script which uses urllib2.urlopen(). Running it outside of Pycharm is successful, running it inside Pycharm gives "urllib2.HTTPError: HTTP Error 407: Proxy Authentication Required". I've configured the Http proxy correctly in PyCharm's settings too.

What else do I need to configure?
Thanks a lot.
How do you set up the proxy authentication? PyCharm's settings affect only network connections initiated by PyCharm itself, not by your code run from PyCharm.
--
Dmitry Jemerov, Chief Technology Officer, JetBrains

I've set up proxy authentication via the environment variables and via /etc/environment. 'export http_proxy="http://user:pass@ip:port/' and same for https_proxy.

Again, if I run the script via 'python script.py' from the terminal, it works flawlessly...

PyCharm is normally not started from the shell and therefore does not see the environment variables defined in /etc/environment. The easiest thing you can do is set up these environment variables in the PyCharm run configuration settings.
--
Dmitry Jemerov, Chief Technology Officer, JetBrains