在使用python安装各种模块时,经常使用pip作为安装工具,pip安装默认的访问地址为 http://pypi.python.org/simple/,经常会有网络不稳定和速度慢的现象,出现timeout报错。
因此经常使用国内源替换,很多博客推荐了豆瓣源,我再用豆瓣源下载scipy模块时,报了如下错误
RuntimeError: Python version >= 3.5 required.
应该是我的python版本(2.7)的问题,比较好用的是清华大学的源:
https://pypi.tuna.tsinghua.edu.cn/simple
使用格式(以scipy)为例:
pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
永久修改pip安装源的方式
【Linux】修改默认镜像源的操作
vi ~/.pip/pip.conf
在文件中添加如下内容
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com