Conda install ProxyError解决方案

报错信息

当使用 conda install 安装软件时往往会出现如下报错:

$ conda install -n [envs] -c [channels] [packages]

Collecting package metadata (repodata.json): failed
ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any '.netrc' file in your home directory,
any environment variables ending in '_PROXY', and any other system-wide proxy
configuration settings.
问题分析

使用企业集群大型机安装软件时,出于安全考虑,一般会走代理。而 conda 无法自动识别代理IP和端口,因此需要为 conda 配置文件指定代理IP和端口

解决方案
  1. 查看软件安装节点(联网节点)的代理IP和端口
$ echo $http_proxy
http://10.53.15.246:3128
$ echo $https_proxy
https://10.53.15.246:3128
  1. 设置conda的配置文件,一般在home目录下 ~/.condarc ,打开配置文件后,如下设置 proxy_servers 并保存即可
$ vi ~/.condarc
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults
show_channel_urls: true
proxy_servers:
  http: http://10.53.15.246:3128
  https: https://10.53.15.246:3128
ssl_verify: false
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容