Python 3.3 的 Pygame 安装
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14115440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Pygame installation for Python 3.3
提问by ShroomBandit
I am trying to import Pygameto use for my version of Python, 3.3. The downloads on the Pygame website only have Python 3.1 and 3.2. I cannot seem to be able to import Pygame though I thought I had it installed in the correct path. I have tried both the 3.1 and 3.2 Pygame downloads.
我正在尝试导入Pygame以用于我的Python3.3版本。Pygame 网站上的下载只有 Python 3.1 和 3.2。尽管我认为我已将其安装在正确的路径中,但我似乎无法导入 Pygame。我已经尝试了 3.1 和 3.2 Pygame 下载。
Is Pygame just not installed in the correct file path or is Pygame not compatible with my version of Python (3.3)?
是 Pygame 没有安装在正确的文件路径中还是 Pygame 与我的 Python (3.3) 版本不兼容?
I am running Windows 7 and here is the error:
我正在运行 Windows 7,这是错误:
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
import pygame
File ".\pygame\__init__.py", line 95, in <module>
from pygame.base import *
ImportError: DLL load failed: The specified module could not be found.
采纳答案by Paul Vincent Craven
The main Pygame page seems to be rarely updated. You can download Pygame releases direct from Bitbucketat https://bitbucket.org/pygame/pygame/downloads.
Pygame 主页面似乎很少更新。您可以在https://bitbucket.org/pygame/pygame/downloads直接从Bitbucket下载 Pygame 版本。
回答by Slobodan Stevic
If the solution from the Paul Vincent Craven's answer gives you "Python version 3.3 required, which was not found in the registry.", you have to download and install this version from the official download site:
如果 Paul Vincent Craven 的回答中的解决方案为您提供“需要 Python 3.3 版,但未在注册表中找到。”,您必须从官方下载站点下载并安装此版本:
Python 3.3.0 Windows X86-64 MSI Installer
回答by Daniel Heidemann
If you are on Windows and have Python 3.3, open the download page on bitbucket. Download: pygame-1.9.2a0.win32-py3.3.msi
如果您使用的是 Windows 并且拥有 Python 3.3,请打开bitbucket 上的下载页面。下载:pygame-1.9.2a0.win32-py3.3.msi
Then you can test if you have Pygame by importing pygame.
然后你可以通过导入pygame.
回答by Ben Marth
I have had this problem also. Pygame has to be compatible with the version of Python and the type of computer you have. For example, if you have Python version 3.3.2, but downloaded Pygame version 2.7.1, the "import pygame" function will be impossible to use.
我也有这个问题。Pygame 必须与 Python 版本和您拥有的计算机类型兼容。例如,如果您有 Python 3.3.2 版本,但下载了 Pygame 2.7.1 版本,则“import pygame”功能将无法使用。
回答by user3100799
You need to download the version of Pygame that is equivalent to Python 3.3 from Bitbucketand Pygame is only available in 32 bit, so you need to make sure that Python is 3.3 32 bit. Download from: https://bitbucket.org/pygame/pygame/downloads
您需要从Bitbucket下载等效于Python 3.3 的Pygame 版本,而Pygame 仅支持32 位,因此您需要确保Python 是3.3 32 位。下载地址:https: //bitbucket.org/pygame/pygame/downloads
回答by GrvTyagi
sudo apt-get install python-pygame
Raise some errors like 404 for some packages so
https://community.webfaction.com/questions/315/how-do-i-install-pygame
This link help full for me
sudo apt-get install python-pygame
为某些软件包引发一些错误,例如 404,所以
https://community.webfaction.com/questions/315/how-do-i-install-pygame
这个链接对我很有帮助
回答by Zeniel Danaku
Every time I update my python verion (currently I'm working with python 3.3), I download a special build for pygame, from this adress. It has builds for many other packages, so I think it is worth to check it out.
每次我更新我的 python 版本(目前我正在使用 python 3.3)时,我都会从这个地址下载一个特殊的 pygame 版本。它有许多其他软件包的构建,所以我认为值得一试。

