Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
431 views
in Technique[技术] by (71.8m points)

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

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

When I have have the following environment variables:

http_proxy: http://domainusername:[email protected]:8080
https_proxy: https://domainusername:[email protected]:8080

or just

http_proxy: http://serverusername:[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 "cAnaconda2", 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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: http://proxy.yourorg.org:port


ssl_verify: False

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...