服务器安装conda环境遇到代理PROXY问题及解决方案

 更新时间:2023年07月06日 08:59:09   作者:丘疾之不能伏  
这篇文章主要为大家介绍了服务器安装conda环境遇到代理PROXY问题及解决方案,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

背景

ProxyError: Conda cannot proceed due to an error in your proxy configuration.

使用的是组里的服务器,主要是在创建虚拟环境以及在已创建的虚拟环境中使用运行时都出现了同样的ProxyError,主要是因为conda没法处理代理,因此得要用户手动修改**.condarc**文件。一共分为两步

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.

1: 创建环境时出现ProxyError

~$ conda create -n nn
Collecting package metadata (current_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.

解决方案

首先进入**.condarc**文件,通常为空

~$ vim .condarc

这里对**.condarc**的修改如下:

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

之后conda可以创建虚拟环境,本以为一切ok准备安装一些依赖包的时候,ProxyError再次出现。

2:安装依赖时出现ProxyError

安装pytorch时错误再次出现

~$ conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
Collecting package metadata (current_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.

解决方案:

同样是对**.condarc**文件进行修改,首先查看自己的代理ip

~$ echo $http_proxy
http://...

复制打印出的代理ip地址并添加到**.condarc**配置文件中。(地址都是http,不是https)

proxy_servers:
  http: http://...
  https: http://...
ssl_verify: False

以上就是服务器安装conda环境遇到代理PROXY问题及解决方案的详细内容,更多关于服务器安装conda PROXY的资料请关注脚本之家其它相关文章!

相关文章

  • Yolov5服务器环境搭建详细过程

    Yolov5服务器环境搭建详细过程

    这篇文章主要介绍了Yolov5服务器环境搭建,本文通过脚本命令图文介绍给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2022-04-04
  • Cobbler 批量安装操作系统的配置方法

    Cobbler 批量安装操作系统的配置方法

    Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows。该工具使用python开发,小巧轻便(才15k行代码),使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP,DNS,以及yum包镜像
    2016-08-08
  • 详解在阿里云上搭建自己的git服务器

    详解在阿里云上搭建自己的git服务器

    本篇文章主要介绍了在阿里云上搭建自己的git服务器,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-11-11
  • Win2008 蓝屏漏洞揭秘

    Win2008 蓝屏漏洞揭秘

    蓝屏漏洞威胁的是服务器操作系统Windows Server 2008,这意味着如果Windows Server 2008蓝屏,将导致服务器停止服务……
    2009-10-10
  • Memcached缓存系统的介绍、安装以及应用方法详解

    Memcached缓存系统的介绍、安装以及应用方法详解

    这篇文章主要介绍了Memcached缓存系统的介绍、安装以及应用方法,详细分析了Memcached的安装、启动,并给出了php与C++使用Memcached的方法,需要的朋友可以参考下
    2016-05-05
  • Windows下搭建MQTT服务器的详细教程

    Windows下搭建MQTT服务器的详细教程

    这篇文章主要介绍了Windows下搭建MQTT服务器的方法,基于mosquitto实现,有需要的朋友可以参考下
    2023-08-08
  • SVN使用教程_动力节点Java学院整理

    SVN使用教程_动力节点Java学院整理

    这篇文章主要为大家详细介绍了SVN使用教程和注意事项,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2017-08-08
  • 详解阿里云服务器添加安全组规则(图文教程)

    详解阿里云服务器添加安全组规则(图文教程)

    这篇文章主要介绍了详解阿里云服务器添加安全组规则(图文教程),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2020-07-07
  • 详解如何将本地JAR包添加到本地Maven仓库中

    详解如何将本地JAR包添加到本地Maven仓库中

    这篇文章主要介绍了详解如何将本地JAR包添加到本地Maven仓库中的相关资料,希望通过本文能帮助到大家来实现这样的功能,需要的朋友可以参考下
    2017-09-09
  • 分享几款linux下常见的vps控制面板

    分享几款linux下常见的vps控制面板

    VPS主机控制面板主要是用来控制和管理VPS服务器的,一般来说如果想要将VPS主机共享出来给多个人使用的话,我们就会采用类似于Cpanel、Virtualmin等主机控制面板。如果VPS主机只是一个人使用的话部落建议还是不要使用主机控制面板,以免带来不必要的安全隐患
    2017-07-07

最新评论