【问题标题】:Pygame installation for Python 3.3Python 3.3 的 Pygame 安装
【发布时间】:2015-11-27 08:27:38
【问题描述】:

我正在尝试导入Pygame 以用于我的Python 3.3 版本。 Pygame 网站上的下载只有 Python 3.1 和 3.2。尽管我认为我已将它安装在正确的路径中,但我似乎无法导入 Pygame。我已经尝试过 3.1 和 3.2 Pygame 下载。

是 Pygame 没有安装在正确的文件路径中,还是 Pygame 与我的 Python (3.3) 版本不兼容?

我运行的是 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.

【问题讨论】:

    标签: python pygame


    【解决方案1】:

    Pygame 主页面似乎很少更新。您可以直接从Bitbuckethttps://bitbucket.org/pygame/pygame/downloads 下载 Pygame 版本。

    【讨论】:

    • 对于 windows,有一个不错的存储库,其中包含更多最新的 bnaries(在我写这篇文章时,他们有一个用于 Python 3.5 在 win 32 和 64 位上的 Pygame 安装程序):lfd.uci.edu/~gohlke/pythonlibs/#pygame
    【解决方案2】:

    如果 Paul Vincent Craven 回答中的解决方案给您“需要 Python 版本 3.3,但在注册表中找不到。”,您必须从 official download site 下载并安装此版本:

    Python 3.3.0 Windows X86-64 MSI Installer
    

    【讨论】:

      【解决方案3】:

      如果您使用的是 Windows 并使用 Python 3.3,请打开 the download page on bitbucket。下载:pygame-1.9.2a0.win32-py3.3.msi

      然后你可以通过导入pygame来测试你是否有Pygame。

      【讨论】:

        【解决方案4】:

        每次我更新我的 python 版本(目前我正在使用 python 3.3)时,我都会从 this adress 下载一个用于 pygame 的特殊构建。它有许多其他包的构建,所以我认为值得一试。

        【讨论】:

          【解决方案5】:

          我也遇到过这个问题。 Pygame 必须与 Python 的版本和您拥有的计算机类型兼容。例如,如果你的 Python 版本是 3.3.2,但下载的 Pygame 版本是 2.7.1,“import pygame”功能将无法使用。

          【讨论】:

            【解决方案6】:

            你需要从Bitbucket下载相当于Python 3.3的Pygame版本,并且Pygame只有32位,所以你需要确保Python是3.3 32位。下载地址:https://bitbucket.org/pygame/pygame/downloads

            【讨论】:

            • 您好,我试图在 bitbucket 上验证 3.3 版 pygame 的存在,但没有找到。我认为这只是一个错字,而您的意思是 Python 版本号。您能否更正此信息并提供指向正确下载页面的直接链接?谢谢!
            【解决方案7】:

            sudo apt-get install python-pygame
            为某些软件包引发一些错误,例如 404,所以
            https://community.webfaction.com/questions/315/how-do-i-install-pygame
            这个链接对我很有帮助

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 2013-12-01
              • 2014-01-24
              • 2016-08-02
              • 1970-01-01
              • 2013-08-24
              • 1970-01-01
              • 1970-01-01
              • 2014-06-17
              相关资源
              最近更新 更多