如何在Python2.7上安装PyGame(win 64)

2024-05-19 17:03:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在win_64(windows 10)上用python 2.7安装pygame,但我给出了一些错误!

 pip install hg+http://bitbucket.org/pygame/pygame

它给了我一个错误:

 Cannot unpack file c:\users\ahmad\appdata\local\temp\pip-xatkk_-    unpack\download.shtml (downloaded from c:\users\ahmad\appdata\local\temp\pip- ki5epe-build, content-type: text/html); cannot detect archive format
 Cannot determine archive format of c:\users\ahmad\appdata\local\temp\pip-ki5epe-build)

运行此命令:

 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, content-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 http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz

给我:

Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\ahmad\\appdata\\local\\temp\\pip-vt49bq-build\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\ahmad\appdata\local\temp\pip-lclwur-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\ahmad\appdata\local\temp\pip-vt49bq-build)

还有一些像这样的错误。


Tags: installpipbuildformatlocal错误pygameusers
2条回答

既然你在windows上,pip就一团糟了。考虑继续http://www.pygame.org/download.shtml,然后下载可执行文件或msi。

首先去这个网站http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame下载你需要的版本。打开cmd后,导航到下载了pygame文件的文件夹并运行pip install file_name.whl

如果您没有安装pip,请从该站点下载它https://pip.pypa.io/en/latest/installing/再次导航到该文件夹并在cmdpython get pip.py中运行

相关问题 更多 >