Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Anaconda work behind HTTP proxy (not https)?

Tags:

I'm having trouble working with Anaconda behind a proxy at work.

When I have have the following environment variables:

http_proxy: http://domain\username:[email protected]:8080
https_proxy: https://domain\username:[email protected]:8080

or just

http_proxy: http://server\username:[email protected]:8080

set up then git works. But Anaconda does not work. I'm trying to run

conda update conda

and I get:

Could not connect to https://repo.continuum.io/pkgs....
Could not connect to https://repo.continuum.io/pkgs....

Does Anaconda not work with http? and requires an https proxy? Because I'm thinking my company may not have an https proxy server setup (I've only seen them use http). or sometimes I get the error:

File "c\Anaconda2\", line 340, in wait
    waiter.acquire()
KeyboardInterrupt
Could not connect to https://repo.continuum.io/pkgs....
Could not connect to https://repo.continuum.io/pkgs....

I'm using Windows 7.

like image 892
Alo Avatar asked Apr 19 '16 20:04

Alo


People also ask

How do I enable proxy in Python?

To use a proxy in Python, first import the requests package. Next create a proxies dictionary that defines the HTTP and HTTPS connections. This variable should be a dictionary that maps a protocol to the proxy URL. Additionally, make a url variable set to the webpage you're scraping from.

How do you pass a proxy in Python?

Another way to pass a proxy address to Python is to set the http_proxy and https_proxy environment variables. If you set environment variables, you don't need to define any proxies in your code. Just be aware that proxy settings passed through code now override settings set via environment variables.


1 Answers

you need to create a .condarc file in you Windows user area:

C:\Users\<username>\

The file should contain:

channels:
- defaults

# Show channel URLs when displaying what is going to be downloaded and
# in 'conda list'. The default is False.
show_channel_urls: True
allow_other_channels: True

proxy_servers:
    http: http://proxy.yourorg.org:port
    https: https://proxy.yourorg.org:port


ssl_verify: False
like image 199
ctrl-alt-delete Avatar answered Oct 08 '22 19:10

ctrl-alt-delete