python - 在命令提示符下使用 pip 安装软件包
问题描述
我正在尝试从 PyPi 安装 requests 包,但是当我运行时:
c:\Users\someone\AppData\Local\Programs\Python\Python37\Scripts>pip install requests
它不安装 requests 包(和任何其他包......),输出:
Collecting requests
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
我见过其他人有我的问题,但没有答案对我有帮助。我能做些什么?
更详细的输出:
c:\Users\noahe\AppData\Local\Programs\Python\Python37\Scripts>pip -v install requests
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Created temporary directory: C:\Users\noahe\AppData\Local\Temp\pip-ephem-wheel-cache-v11o20qd
Created temporary directory: C:\Users\noahe\AppData\Local\Temp\pip-req-tracker-9en3tmuz
Created requirements tracker 'C:\\Users\\noahe\\AppData\\Local\\Temp\\pip-req-tracker-9en3tmuz'
Created temporary directory: C:\Users\noahe\AppData\Local\Temp\pip-install-61qhx850
Collecting requests
1 location(s) to search for versions of requests:
* https://pypi.org/simple/requests/
Getting page https://pypi.org/simple/requests/
Looking up "https://pypi.org/simple/requests/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Starting new HTTPS connection (2): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=3, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Starting new HTTPS connection (3): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Starting new HTTPS connection (4): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Starting new HTTPS connection (5): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))': /simple/requests/
Starting new HTTPS connection (6): pypi.org:443
Could not fetch URL https://pypi.org/simple/requests/: connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))) - skipping
Could not find a version that satisfies the requirement requests (from versions: )
Cleaning up...
Removed build tracker 'C:\\Users\\noahe\\AppData\\Local\\Temp\\pip-req-tracker-9en3tmuz'
No matching distribution found for requests
Exception information:
Traceback (most recent call last):
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 176, in main
status = self.run(options, args)
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
resolver.resolve(requirement_set)
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve
self._resolve_one(requirement_set, req)
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for
self.require_hashes
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 269, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\req\req_install.py", line 196, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "c:\users\noahe\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\index.py", line 688, in find_requirement
'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for requests
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
1 location(s) to search for versions of pip:
* https://pypi.org/simple/pip/
Getting page https://pypi.org/simple/pip/
Looking up "https://pypi.org/simple/pip/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
Could not fetch URL https://pypi.org/simple/pip/: connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by ProtocolError('Connection aborted.', ConnectionResetError(10054, "Connessione in corso interrotta forzatamente dall'host remoto", None, 10054, None))) - skipping
我不知道如何编辑它,它的代码太多了。
解决方案
推荐阅读
- matlab - 快速拆分字符串
- go - 没有处理程序的 Mux 中间件
- python - 当值是 (2x2) numpy 数组时,在独立字典中添加值
- javascript - 使用 MongoDb 在 JS 中损坏的图像源
- amazon-web-services - 运行 Amplify Auth Update 后运行 Amplify Push 时出错
- bash - .bashrc 中的函数 ping+() 不起作用
- ruby - 测试进入 rspec(用户输入)
- angular - 在 Angular 中使用字体加载器
- .net - 如何将背景图像与 Windows 窗体中的按钮对齐(Visual Studio)
- google-apps-script - 如何在 Google docs 上按 Enter 键运行我的功能