使用公司内网的机器安装 anaconda ,要使用代理才能 正常联网

。如下几种方式但始终 不成功 提示代理错误

  1. 设置ananconda 的 .condarc 的 proxy_servers字段
    https_proxy https://xxxx.sxxxx:8080
    http_proxy http://xxx.x.sxxxx:8080

  2. 设置系统变量
    HTTPS_PROXY ="https://xxxx.sxxxx:8080"
    HTTP_PROXY="http://xxx.sxxxxx:8080"

都不行 始终提示 代理错误, 突然发现 提示 你的 https_proxy 实际是 http 协议不是 https协议,请将https_proxy改为 http协议
于是 将
https_proxy https://xxxx.sxxxx:8080
HTTPS_PROXY ="https://xxxx.sxxxx:8080"
改为
**https_proxy http://xxxx.sxxxx:8080
HTTPS_PROXY ="http://xxxx.sxxxx:8080"
**
重启系统, 成功,可以通过代理 下载更新文件le

我的具体步骤
1.
在 /etc/profile.d/下 建立 proxy.sh文件, 填写如下信息

export https_proxy="http://xxx.xxxxxxxx:8080"
export http_proxy="http://xxx.xxxxxxxx:8080"
export ftp_proxy="http://xxx.xxxxxxxx:8080"
export no_proxy="localhost, 127.0.0.0/8,..."

export HTTPS_PROXY="http://xxx.xxxxxxxx:8080"
export HTTP_PROXY="http://xxx.xxxxxxxx:8080"
export FTP_PROXY="http://xxx.xxxxxxxx:80800"
export NO_PROXY="localhost, 127.0.0.0/8,..."

保存 重启系统。

2.通过修改 ~/.condarc 设置https代理为http://xxx.xxxxx:8080 也可以

posted on 2024-04-25 16:54  keleman  阅读(97)  评论(0编辑  收藏  举报