简体   繁体   中英

How to install PyGame on Python 2.7 (win 64)

I want to install pygame in python 2.7 on win_64 (windows 10) but I give some Error!

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

it gives me an error:

 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)

Running this command:

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

gives me :

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

Gives me:

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)

And some Errors like these.

First go to this site http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame and download the version you need. After open cmd, navigate to the folder you downloaded the pygame file and run pip install file_name.whl

If you dont have pip installed, download it from this site https://pip.pypa.io/en/latest/installing/ navigate again to the folder and run in cmd python get-pip.py

Since you're on windows pip is a mess. Consider going on http://www.pygame.org/download.shtml and then downloading an executable or msi.

你可能会在这个网站上找到http://www.pygame.org/download.shtml只需搜索你想要的版本并安装它

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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