首页 > 解决方案 > 无法在 pycharm 中安装软件包并且还使用命令提示符错误“找不到版本”

问题描述

我无法使用 Pycharm Professional 2019(Windows 10、64 位)安装任何软件包。

它总是生成相同的错误 «非零退出代码 (1) 找不到满足要求请求的版本(来自版本:)没有为请求找到匹配的分布 。它还告诉检查为 Python 安装的pip版本。我的pip版本是 Python-3.7.4 的“pip 19.0.3”

下面的屏幕截图显示了 Pycharm [Error in pycharm][1] 中发生的错误。使用[命令提示符导致几乎相同的错误][2]

我还尝试将存储库更改为https://pypi.python.org/pypi但它也没有帮助。

我试试这个。但仍然出现错误

C:\>pip --proxy=http://pypi.python.org/simple/ --trusted-host pypi.python.org install requests
Collecting requests
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000022BB22A0D88>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))': /simple/requests/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000022BB22C1988>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))': /simple/requests/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000022BB22C1888>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))': /simple/requests/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000022BB22CBA08>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))': /simple/requests/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000022BB22C1DC8>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))': /simple/requests/
  Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests 

这也是

C:\>pip install requests
Collecting requests
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AD172C248>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AD1728D08>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AD1728C08>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AD1728CC8>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000025AD17106C8>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/requests/
  Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
``````````````````````````



  [1]: https://i.stack.imgur.com/TcgjN.png
  [2]: https://i.stack.imgur.com/haNxX.png

标签: pythoncmdpycharmwindows-10package

解决方案


此问题可能是由于您端的代理或防火墙设置造成的。请检查您的代理设置


推荐阅读