安装pygame错误

安装pygame错误

(py_game) C:\Users\lenovo\PycharmProjects\untitled2>pip install pygame
Collecting pygame
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04B72F40>, 'C
onnection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04A3A208>, 'C
onnection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04B97898>, 'C
onnection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04B97A18>, 'C
onnection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04B97838>, 'C
onnection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c
8094d6441db2be/pygame-1.9.6.tar.gz (Caused by ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04B979B8>, 'Connection to files.pythonhosted.org timed out. (connect timeout
=15)'))

正在回答

登陆购买课程后可参与讨论,去登陆

2回答

同学,你好。报连接超时错误,pip安装时默认使用国外源下载,同学可以选择国内的下载源来进行安装。如清华大学下载源:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pygame。

如果解决了你的疑惑,请采纳,祝学习愉快~ 

  • 慕娘4151665 提问者 #1
    现在pygame已经安装完成了,从任务管理器可以进去,但是虚拟环境里的还是安装不了,出现的错误上面的回答就是
    2020-06-11 17:21:41
  • 好帮手慕笑蓉 回复 提问者 慕娘4151665 #2
    同学,你好。此错误是网络原因造成的,建议等网络好一点的时候,再次用pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pygame命令尝试。 祝学习愉快~
    2020-06-11 17:31:23
  • 慕娘4151665 提问者 #3
    或者我可以不创建虚拟环境进行后续的学习么
    2020-06-11 17:33:33
提问者 慕娘4151665 2020-06-11 17:20:53
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
1.Python零基础入门
  • 参与学习           人
  • 提交作业       2727    份
  • 解答问题       8160    个

想要进入Python Web、爬虫、人工智能等高薪领域,你需要掌握本阶段的Python基础知识,课程安排带你高效学习轻松入门,学完你也能听得懂Python工程师的行业梗。

了解课程
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师