0.环境
ubuntu16.04
python3.6
1.问题
pip下载出问题,尝试网上的各种方法如这个高赞文章:https://blog.csdn.net/lsf_007/article/details/87931823
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9a14c47b70>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /pypi/simple/hpbandster/
apt-get update更新用不了
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:3 http://mirrors.aliyun.com/ubuntu xenial InRelease
Temporary failure resolving 'mirrors.aliyun.com'
Err:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 InRelease
2.问题解决
不抱希望的试了下。直接输入以下解决:
echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null
pip安装正常
pip install -i https://mirrors.aliyun.com/pypi/simple hpbandster ConfigSpace hyperopt
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting hpbandster
Downloading https://mirrors.aliyun.com/pypi/packages/13/3e/62192b0bb527d9353d222b4b6df14400b3c4f36a92a2b138f11a5eafe000/hpbandster-0.7.4.tar.gz (51 kB)
|################################| 51 kB 4.7 kB/s
apt-get update正常
Get:1 http://mirrors.aliyun.com/ubuntu xenial InRelease [247 kB]
Get:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease [107 kB]
Get:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease [18.0 kB]
3.建议
对于网上要改什么proxy的,慎重!!!这么点事,整了几个小时,对网络不懂,真是能把自己坑成傻子!
4.参考
1.apt-get update fails to fetch files, “Temporary failure resolving …” error