pip安装pypi包read timeout问题(镜像解决)

背景

我要安装一个库:
pip install scikit-image
网络不好遇到错误:
read time out

先说方法

pip install --user numpy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

解释

  • 参考博客:python安装numpy和pandas
    博主解释:源安装超级慢,所以推荐使用豆瓣的源
    用法:
pip install matplotlib -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip install numpy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip install seaborn scipy  -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
  • 注意:不要用下面这个(很多帖子提供的解决方案):
    pip install web.py -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
    因为它(在我这里)会出现问题:
    Command "python setup.py egg_info" failed with error code 1
    然后继续搜索问题,大家的解决方案是(参考):
sudo python -m pip install --upgrade --force pip 
sudo pip install setuptools==33.1.1

查了一下这大概是强制重装pip,因为我比较介意重装pip,所以就没有继续沿着这条线走。

  • 不用--user会出现下面这样的问题报错:
    Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/python3/lib/python3.6/site-packages/Pillow-5.2.0.dist-info' Consider using the `--user` option or check the permissions.

你可能感兴趣的:(pip安装pypi包read timeout问题(镜像解决))