繁体   English   中英

无法为python安装pygame

[英]Can't install pygame for python

今天早上我尝试在Windows命令提示符下安装pygame并得到如下错误:

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

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

C:\Users\User>

所以我尝试运行anaconda来安装pygame,但是我得到了另一个错误。

(base) C:\Users\User>conda install -c cogsci pygame
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pk
gs/pro/win-64/repodata.json.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.


If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443
): Max retries exceeded with url: /pkgs/pro/win-64/repodata.json.bz2 (Caused by
SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_ce
rtificate\', \'certificate verify failed\')])")))'))



(base) C:\Users\User>

我无法理解错误。该命令之前正在运行,但它现在不起作用。我认为这是连接错误,但我可以顺利运行任何网站。我该怎么办?

可以通过访问pygame.org并下载.MSI安装程序在Windows上安装PyGame 这不依赖于pipanaconda

您收到的问题似乎是SSL证书问题,与PyGame无关。 您的安装方法都存在与SSL相同的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM