conda创建虚拟环境时报ConnectionError

gaoyanping@SWD-GAOYPING-INT:~$ conda create -n hades python=2.7
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

ConnectionError(MaxRetryError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/r/noarch/repodata.json.bz2 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))"))

 

解决方案:

修改anaconda的配置文件,.condarc文件,添加代理

1、如果公司代理不使用用户名密码

  1. proxy_servers:

    1. http: http://xxxx:8080

2、代理需要用户名

  1. proxy_servers:

    1. http: http://user:password@xxxx:8080

    2. https: https://user:password@xxxx:8080

本人解决问题措施:

vim .condrc

proxy_servers:
    http: http://gaoyanping:Aa123456@xxxx:808
    https: https://gaoyanping:Aa123456@xxxx:808

你可能感兴趣的:(ubuntu,conda)