使用pip安装第三方库报错记录

    今天在使用pycharm导入第三方库的时候,报了好多超时错误,还有标题中的找不到版本,应该是网络的原因,记录下解决的办法:

raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.

1.设置超时时间

pip --default-timeout=100 install -U Pillow

如果网络实在太差,把超时时间设置再大点可以解决

Could not find a version that satisfies the requirement xxxxx(from version:)   No matching distribution found for xxxx

2.使用国内镜像源来加速

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

我遇到两个错误都用这两个办法完美解决,记录分享下,以备不时之需。

原文地址:https://www.cnblogs.com/dreamyu/p/8232300.html