服务器安装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的资料请关注脚本之家其它相关文章!

相关文章

  • WampServer下使用多端口访问的技巧

    WampServer下使用多端口访问的技巧

    由于在学习中要用到跨域请求,所以不得不在wamp集成环境下添加多站点服务。本文主要给大家介绍wampserver下使用多端口访问,需要的朋友可以参考下
    2015-10-10
  • 使用华为云鲲鹏弹性云服务器部署Discuz的详细过程

    使用华为云鲲鹏弹性云服务器部署Discuz的详细过程

    这篇文章主要介绍了使用华为云鲲鹏弹性云服务器部署Discuz,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2023-05-05
  • Cloudflare免费免备案cdn加速优化设置方法指南

    Cloudflare免费免备案cdn加速优化设置方法指南

    CDN加速是利用节点让用户建成访问时,直接将缓存好的静态文件交给用户。还可以隐藏我们网站的IP地址,变得更安全。Cloudflare CDN免费加速你的网站,合适的配置会使我们网站的访问速度和安全性都得到进一步的提升。
    2023-04-04
  • 32位操作系统认出超出4G内存的方法

    32位操作系统认出超出4G内存的方法

    编辑操作系统安装盘下boot.ini文件(隐藏文件),在[operating systems]的行后,加入/PAE,保存,重启系统后,就会认出超出4G的内存。
    2009-06-06
  • Dell R730服务器6i阵列卡Raid5配置方法(热备)

    Dell R730服务器6i阵列卡Raid5配置方法(热备)

    这篇文章主要介绍了Dell R730服务器6i阵列卡Raid5配置方法,需要的朋友可以参考下
    2018-05-05
  • 如何使用Linux搭建web服务器

    如何使用Linux搭建web服务器

    web 服务器提供的这些数据大部分都是文件,那么我们需要在服务器端先将数据文件写好,并且放置在某个特殊的目录下面,这个目录就是我们整个网站的首页,在 redhat 中,这个目录默认在/var/www/html,这篇文章主要介绍了如何使用Linux搭建web服务器,需要的朋友可以参考下
    2023-12-12
  • Hadoop SSH免密码登录以及失败解决方案

    Hadoop SSH免密码登录以及失败解决方案

    这篇文章主要介绍了Hadoop SSH免密码登录以及失败解决方案的相关资料,需要的朋友可以参考下
    2016-12-12
  • HTTP响应字段Transfer-Encoding含义及作用详解

    HTTP响应字段Transfer-Encoding含义及作用详解

    在HTTP通信中,响应正文可以以多种不同的编码方式传输,其中一种方式是chunked传输编码,本文将详细介绍Transfer-Encoding字段的含义和chunked传输编码,以及提供示例来解释这些概念
    2023-11-11
  • RAID制作教程图文详解

    RAID制作教程图文详解

    这篇文章主要介绍了主流的带有RAID功能的升技主板基本的RAID创建过程的介绍,希望能够给对RAID有兴趣的升技主板用户有所帮助
    2013-06-06
  • 护卫神 主机管理系统使用说明篇 系统设置

    护卫神 主机管理系统使用说明篇 系统设置

    护卫神·主机管理系统支持在Windows Server 2003/2008/2012,含32位和64位,直接开设配置WEB站、FTP站,以及SQL Server和MySQL,是您开设和管理虚拟主机的绝好帮手,但是对于新用户可能在使用上有一些困难,因此请仔细阅读如下说明文档
    2015-01-01

最新评论