Skip to main content
 首页 » 编程设计

python之使用 pip 安装包返回错误

2024年12月31日7lautakyan007

<分区>

前一段时间我从https://pip.pypa.io/en/stable/installing/下载了pip 在我意识到我的 python 版本 allready 带有 pip 之前。我成功地使用它下载了 pygame,但现在我正在尝试下载 numpy,无论我尝试什么,它都会返回以下错误。

我尝试重新安装 pip 和 python 但没有任何改变。我认为这与我不小心从上面的链接下载 pip 并拥有两个版本的 pip 有关。当我卸载 pip 时,它不是被卸载的那个,如果其中任何一个有意义的话。无论如何,这只是我的理论。

这是我尝试安装任何东西时发生的事情

C:\Users\riley>pip install numpy 
Collecting numpy 
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /simple/numpy/ 
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /simple/numpy/ 
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /simple/numpy/ 
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /simple/numpy/ 
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /simple/numpy/ 
  Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))) - skipping 
  Could not find a version that satisfies the requirement numpy (from versions: ) 
No matching distribution found for numpy 
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))) - skipping 

它也可能与链接有关,因为它转到错误的页面。请帮助我没有我正在尝试安装的软件包无法做任何事情。解决方案将不胜感激。

编辑 这篇文章不是已提出的其他问题的重复,这是重复的,因为我不相信这种情况或该问题的答案与我的有关。