Requests Behind Corporate Proxies in Python

How to configure Plotly's Python API to work with corporate proxies


New to Plotly?

Plotly is a free and open-source graphing library for Python. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials.

If you are behind a corporate firewall, you may see the error message:

requests.exceptions.ConnectionError: ('Connection aborted.', TimeoutError(10060, ...)

Plotly uses the requests module to communicate with the Plotly server. You can configure proxies by setting the environment variables HTTP_PROXY and HTTPS_PROXY.

$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"

To use HTTP Basic Auth with your proxy, use the http://user:password@host/ syntax:

$ export HTTP_PROXY="http://user:pass@10.10.1.10:3128/"

Note that proxy URLs must include the scheme.

You may also see this error if your proxy variable is set but you are no longer behind the corporate proxy. Check if a proxy variable is set with:

$ echo $HTTP_PROXY
$ echo $HTTPS_PROXY

Still not working?

Log an issue

Contact support@plot.ly

Get in touch with your IT department, and ask them about corporate proxies.

Requests documentation on configuring proxies the requests documentation.

Plotly for IPython Notebooks is also available for offline use.

Chart Studio Enterprise is available for behind-the-firewall corporate installations.