Python Anaconda Proxy Setup via .condarc file on Windows

老子叫甜甜 提交于 2019-12-18 10:31:08

问题


I am having trouble going through a proxy for Anaconda install conda on a Windows 7 machine. How do I use a proxy?

http://conda.pydata.org/docs/config.html

the above link is broken, use this one instead


回答1:


I had to create a .condarc file at the C:\Users\username folder.

Use copy con .condarc file if it does not exist at folder above.

File content is:

proxy_servers:
    http: http://username:password@corp.com:8080
    https: https://username:password@corp.com:8080

Two notes:

  • Do not use tabs, there must be space between http: and http://...
  • You might not have a username and password for the proxy. Leave out the username:password part and it will still work



回答2:


On Windows 10 you need to set up additionally the domain name in the .condarc:

channels:
  - admin

show_channel_urls: true
allow_other_channels: true

proxy_servers:
  http: http://domainname\username:password@proxyserver:port
  https: http://domainname\username:password@proxyserver:port

ssl_verify: true



回答3:


On windows 10 machine also. Following accepted answer's format gives a load error, invalid YAML.

Changing '//' to '\' fixed the issue for me.

proxy_servers:
  http: http:\username:password@corp.com:8080
  https: https:\username:password@corp.com:8080



回答4:


In my case on a linux machine behind a McAfee web-gateway proxy, only the following setup worked for conda (I removed the http proxy): hostname:~ # cat .condarc proxy_servers: https: https://domain\user:password@server:port

hostname# conda install tensorflow Solving environment: done

Package Plan

environment location: /anaconda3

added / updated specs: - tensorflow

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
markdown-3.0.1             |           py36_0         107 KB
gast-0.2.0                 |           py36_0          15 KB
libprotobuf-3.6.0          |       hdbcaa40_0         4.1 MB
protobuf-3.6.0             |   py36hf484d3e_0         610 KB
conda-4.5.12               |           py36_0         1.0 MB
termcolor-1.1.0            |           py36_1           7 KB
tensorflow-base-1.9.0      |mkl_py36h2ca6a6a_0        75.7 MB
grpcio-1.12.1              |   py36hdbcaa40_0         1.7 MB
astor-0.7.1                |           py36_0          43 KB
tensorboard-1.9.0          |   py36hf484d3e_0         3.3 MB
tensorflow-1.9.0           |mkl_py36h6d6ce78_1           3 KB
absl-py-0.6.1              |           py36_0         152 KB
_tflow_190_select-0.0.3    |              mkl           2 KB
------------------------------------------------------------
                                       Total:        86.7 MB

The following NEW packages will be INSTALLED:

_tflow_190_select: 0.0.3-mkl
absl-py:           0.6.1-py36_0
astor:             0.7.1-py36_0
gast:              0.2.0-py36_0
grpcio:            1.12.1-py36hdbcaa40_0
libprotobuf:       3.6.0-hdbcaa40_0
markdown:          3.0.1-py36_0
protobuf:          3.6.0-py36hf484d3e_0
tensorboard:       1.9.0-py36hf484d3e_0
tensorflow:        1.9.0-mkl_py36h6d6ce78_1
tensorflow-base:   1.9.0-mkl_py36h2ca6a6a_0
termcolor:         1.1.0-py36_1

The following packages will be UPDATED:

conda:             4.5.4-py36_0             --> 4.5.12-py36_0

Proceed ([y]/n)? y

Downloading and Extracting Packages markdown-3.0.1 | 107 KB | ####################################### | 100% gast-0.2.0 | 15 KB | ####################################### | 100% libprotobuf-3.6.0 | 4.1 MB | ####################################### | 100% protobuf-3.6.0 | 610 KB | ####################################### | 100% conda-4.5.12 | 1.0 MB | ####################################### | 100% termcolor-1.1.0 | 7 KB | ####################################### | 100% tensorflow-base-1.9. | 75.7 MB | ####################################### | 100% grpcio-1.12.1 | 1.7 MB | ####################################### | 100% astor-0.7.1 | 43 KB | ####################################### | 100% tensorboard-1.9.0 | 3.3 MB | ####################################### | 100% tensorflow-1.9.0 | 3 KB | ####################################### | 100% absl-py-0.6.1 | 152 KB | ####################################### | 100% _tflow_190_select-0. | 2 KB | ####################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done



来源:https://stackoverflow.com/questions/33883371/python-anaconda-proxy-setup-via-condarc-file-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!