python easy install時,使用aliyun阿里雲鏡像提示主機名不匹配的問題


因網絡問題,因此設置 easy_install 使用阿里雲的源,

 

## 更新 easy_install 源
tee ~/.pydistutils.cfg <<-'EOF'
[easy_install]
index_url = https://mirrors.aliyun.com/pypi/simple
EOF

但提示

Scanning index of all packages (this may take a while)
Reading https://mirrors.aliyun.com/pypi/simple/
Download error on https://mirrors.aliyun.com/pypi/simple/: hostname 'mirrors.aliyun.com' doesn't match either of 'img.ucdl.pp.uc.cn', 'dl.lianwifi.com', 'cdn.osupdateservice.yunos.com', 'dl.51y5.net', 'oss.ucdl.pp.uc.cn', 'alissl.ucdl.pp.uc.cn', 'iscsi.ucdl.pp.uc.cn', 'slient.ucdl.pp.uc.cn' -- Some packages may not be found!
No local packages or download links found for mkdocs>=0.14.0
error: Could not find suitable distribution for Requirement.parse('mkdocs>=0.14.0')

看提示是說這個鏡像的域名不在列表中,但這個列表感覺和鏡像沒什么關系,開始以為是白名單,但也沒有找到。

最后用列表里面的域名搜到

看到有SSL,感覺可能是https證書這塊的問題,所以把 https://mirrors.aliyun.com/pypi/simple 修改為 http://mirrors.aliyun.com/pypi/simple 后可以正常使用鏡像里面的包來安裝。

但原因實在費解,單獨查看了https://mirrors.aliyun.com的證書並沒有發現問題。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM