繁体   English   中英

使用 pip install 安装 pygame 时遇到问题

[英]Trouble installing pygame using pip install

我试过: c:/python34/scripts/pip install http://bitbucket.org/pygame/pygame

并收到此错误:

Cannot unpack file C:\Users\Marius\AppData\Local\Temp\pip-b60d5tho-unpack\pygame 
(downloaded from C:\Users\Marius\AppData\Local\Temp\pip-rqmpq4tz-build, conte
nt-type: text/html; charset=utf-8); cannot detect archive format
  Cannot determine archive format of C:\Users\Marius\AppData\Local\Temp\pip-rqmp
q4tz-build

如果有人有任何解决方案,请随时分享! 我也试过pip install --allow-unverified ,但这也给了我一个错误。

这是唯一对我有用的方法。

pip install pygame==1.9.1release --allow-external pygame --allow-unverified pygame

-

这些是导致我执行此命令的步骤(我放了它们以便人们容易找到):

$ pip install pygame
Collecting pygame
  Could not find any downloads that satisfy the requirement pygame
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pygame to allow).
  No distributions at all found for pygame

然后,建议,我允许外部:

$ pip install pygame --allow-external pygame
Collecting pygame
  Could not find any downloads that satisfy the requirement pygame
  Some insecure and unverifiable files were ignored (use --allow-unverified pygame to allow).
  No distributions at all found for pygame

因此,我也允许无法验证的内容:

$ pip install pygame --allow-external pygame --allow-unverified pygame
Collecting pygame
  pygame is potentially insecure and unverifiable.
  HTTP error 400 while getting http://www.pygame.org/../../ftp/pygame-1.6.2.tar.bz2 (from http://www.pygame.org/download.shtml)
  Could not install requirement pygame because of error 400 Client Error: Bad Request
  Could not install requirement pygame because of HTTP error 400 Client Error: Bad Request for URL http://www.pygame.org/../../ftp/pygame-1.6.2.tar.bz2 (from http://www.pygame.org/download.shtml)

因此,在访问http://www.pygame.org/download.shtml之后 ,我想到了添加版本号(1.9.1release是当前稳定的版本)。

-

希望能帮助到你。

如果您在安装pygame时遇到麻烦,关于缺少Visual Studio 10+的错误。 我有答案:问题不是关于是否拥有Visual Studio,因为我尝试了很多版本,但是没有用。 问题是文件:在tar.gz.whl之间,这是解决方案:

1)下载文件:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

转到此处下载pygame版本,注意有关x64或x86和python版本的信息。 我的系统是x64,python是3.4,所以我选择: pygame-1.9.2a0-cp34-none-win_amd64.whl

2)将其放在一些安装位置:

我将其放在“ C:”中,因此打开cmd:并键入:cd C:\\(这是将位置更改为C :)

3)安装

pip install C:\pygame-1.9.2a0-cp34-none-win_amd64.whl

完成!

我意识到兼容的Pygame版本只是损坏或损坏。 因此,我必须安装以前版本的python才能运行Pygame。 实际上,这很好,因为大多数模块尚未更新为与Python 3.4兼容,因此它只为我提供了更多选择。

我自己遇到了这个错误(在使用 v3.10.0 时),然后我卸载了最新版本并安装了旧版本的 python(v3.9.7) 并解决了这个问题。 希望这对你也有用。 老实说,除非他们从 python3 跳转到 python4,否则修复程序中没有太多变化。 所以你不需要为了最新性而更新python

暂无
暂无

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

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