之前一直是正常使用 aliyun 的源,配置如下:
# ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
升级 pip 后,运行
>$ pip install virtualenv --upgrade
返回提示:
The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host mirrors.aliyun.com'.
Requirement already up-to-date: virtualenv in /usr/local/lib/python2.7/site-packages
可以看到返回说 virtualenv 是最新的,实际上并没用更新。得运行下面的代码才能升级:
pip install virtualenv --upgrade --trusted-host mirrors.aliyun.com
怎么解决,总不能每次都加 --trusted-host mirrors.aliyun.com
吧?
配置文件里加
trusted-host=mirrors.aliyun.com