Could not find a version that satisfies the requirement passlib (from versions: )

pip安装软件报错

[root@m01 ~]$ pip install passlib
Collecting passlib
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/passlib/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/passlib/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/passlib/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/passlib/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/passlib/
  Could not find a version that satisfies the requirement passlib (from versions: )
No matching distribution found for passlib
![image.png](https://upload-images.jianshu.io/upload_images/20196650-7f9d97bff92f8017.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

分析思路:
①根据提示 (from versions: ) 可能是pip版本过低,需要更新pip:
python -m pip install --upgrade pip

②Read timed out
升级后还是报错,但是错误不一样了.


image.png

应该是网络问题, 国内网络链接python不稳定,需借助国内的源加速

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

借助了国内源瞬间成功!


image.png

你可能感兴趣的:(Could not find a version that satisfies the requirement passlib (from versions: ))