文章目录
问题
利用pip安装python第三方库的时候返回错误提示:The read operation timed out
解决方法
1、采用带参数的pip命令如下:
pip --default-timeout=100 install -U XXX
其中“XXX”为要安装的第三方库名称。
2、采用其他安装源
以安装cython
为例
pip install cython -i https://pypi.tuna.tsinghua.edu.cn/simple
更新pip本身
采用其他安装源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python -m pip install --upgrade pip
#备选
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple
华中理工大学:http://pypi.hustunique.com
山东理工大学:http://pypi.sdutlinux.org
豆瓣:http://pypi.douban.com/simple