Search code examples
python-2.7proxyinstallationplotlyhttp-proxy

Plotly installation fails to establish new connection


I usually use a proxy at my workplace such that I have:

C:\myPath>echo %https_proxy%
http://myUser:myPassword@myProxy:myPort

Now I am at home (it means.. no proxy!) and I am trying to install a package ("plotly"):

C:\myPath>conda install -c plotly plotly=1.3.2
Fetching package metadata ...

CondaHTTPError: HTTP None None
for url <None>

An HTTP error occurred when trying to retrieve this URL.
ProxyError(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /plot
ly/win-64/repodata.json (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3
.connection.VerifiedHTTPSConnection object at 0x0000000004D786A0>: Failed to establish a new connection: [Errno 11004] g
etaddrinfo failed',)))",),)

In order to remove the proxy settings without removing the environment variables I tried:

set http_proxy = ""
set https_proxy= ""

but the situation does not change. I have also tried:

C:\myPath>pip install plotly
Collecting plotly
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot conne
ct to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0
x0000000003C6C400>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))': /simple/plotly/

The questions are: - is the problem my proxy settings? - if it is, how can I change them?


Solution

  • I have solved in a very simple way. The mistake was in the way I removed the proxy. I set:

    C:\myPath>set https_proxy=
    

    and the command

    C:\myPath>conda install -c plotly plotly=1.3.2
    

    worked!

    WARNING: the commands http(s)_proxy= have to contain no blank spaces.