Python 通过 Windows 上的 .condarc 文件设置 Anaconda 代理

Python Anaconda Proxy Setup via .condarc file on Windows

我在 Windows 7 机器上通过 Anaconda 安装 conda 的代理时遇到问题。如何使用代理?

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

the above link is broken, use this one instead

我必须在 C:\Users\username 文件夹中创建一个 .condarc 文件。

如果上面的文件夹中不存在 copy con .condarc 文件,请使用。

文件内容为:

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

两个注意事项:

  • 不要使用制表符,http:http://...
  • 之间必须有space
  • 您可能没有代理的用户名和密码。省略 username:password 部分,它仍然有效

在Windows10你需要在.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

上windows10机也。按照接受的答案格式给出加载错误,YAML 无效。

将“//”更改为“\”解决了我的问题。

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

就我而言,在 McAfee 网络网关代理后面的 linux 机器上,只有以下设置适用于 conda(我删除了 http 代理): 主机名:~#cat.condarc proxy_servers: https: https://domain\用户:密码@服务器:端口

hostname#conda 安装tensorflow 解决环境:完成

套餐计划

环境位置:/anaconda3

添加/更新规格: -张量流

将下载以下包:

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

将安装以下新软件包:

_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

将更新以下软件包:

conda:             4.5.4-py36_0             --> 4.5.12-py36_0

继续([y]/n)?是

正在下载和解压包 降价-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% 康达-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% 准备交易:完成 验证交易:完成 执行交易:完成