pip安装中https不能访问问题---pip._vendor.urllib3.connection.HTTPSConnection

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.问题解决

https://askubuntu.com/questions/91543/apt-get-update-fails-to-fetch-files-temporary-failure-resolving-error 

不抱希望的试了下。直接输入以下解决:

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

  • 8
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wait a minutes

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值