python - 如何让 Anaconda 在 HTTP 代理(不是 https)后面工作?

标签 python git proxy anaconda conda

我在工作中使用代理背后的 Anaconda 时遇到问题。

当我有以下环境变量时:

http_proxy: http://domain\username:password@corp.com:8080
https_proxy: https://domain\username:password@corp.com:8080

或者只是

http_proxy: http://server\username:password@corp.com:8080

设置然后 git 工作。但是 Anaconda 不起作用。 我正在尝试运行

conda update conda

我得到:

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

Anaconda 不支持 http 吗?并需要 https 代理?因为我认为我的公司可能没有 https 代理服务器设置(我只看到他们使用 http)。 或者有时我收到错误:

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....

我使用的是 Windows 7。

最佳答案

您需要在您的 Windows 用户区创建一个 .condarc 文件:

C:\Users\<username>\

文件应包含:

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

关于python - 如何让 Anaconda 在 HTTP 代理(不是 https)后面工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36729023/

相关文章:

python - Dragonfly IntegerRef 出现 TypeError : 'NoneType' object is not callable error

python - 为什么具有复杂无穷大的 NumPy 操作会导致有趣的结果?

git - 传递给 GIT_SSH_COMMAND 的参数 "-i"被忽略

没有工作树就不能使用 git-pull

git初始化并将本地存储库推送到远程未找到

git 错误 : RPC failed; HTTP 502 curl 22 The requested URL returned error: 502 Proxy Error

c - 如何用C语言实现一个HTTPS代理客户端

python - 关于python中dir和import的问题

python - 如何在 python 中使用 pika (RabbitMQ) 向消费者添加多处理

java - Proxy 背后的 SpringBoot 适用于 Undertow 但不适用于 Tomcat