【问题标题】:Having trouble installing pygame?安装 pygame 时遇到问题?
【发布时间】:2013-09-03 02:00:40
【问题描述】:

所以...我正在使用 Python 2.7.5,并且正在尝试安装 pygame。我下载了这个:pygame-1.9.1.win32-py2.7.msi 3.1MB

来自here 并运行程序,然后在 python 文件夹中创建 pygame,据我所知,所有相关文件都在那里。但是,当我尝试从this tutorial 运行示例程序时,它抛出了以下错误消息:L

    Traceback (most recent call last):
  File "C:/Users/USER/Desktop/Bouncing ball", line 1, in <module>
    import sys, pygame
  File "C:\Python27\lib\site-packages\pygame\__init__.py", line 95, in <module>
    from pygame.base import *
ImportError: DLL load failed: %1 is not a valid Win32 application.

有谁知道问题是什么,我可以做些什么来纠正它?如果有帮助,我正在运行 64 位 Windows 7 计算机。

【问题讨论】:

    标签: python python-2.7 pygame


    【解决方案1】:

    看起来您正在使用 64 位 python 并且您安装了 32 位 pygame,您需要找到一个 win64 版本......或者 64 位版本是什么......或者安装 32 位 python 并使用它(我在 64 位机器上使用 32 位 python)

    【讨论】:

    • 成功了,谢谢。我想我对“windows 64bit users note: use the 32bit python with this 32bit pygame.”感到困惑,但我确实安装了 64bit Python,所以这是有道理的。我在这里找到了 64 位:lfd.uci.edu/~gohlke/pythonlibs/#pygame
    • 您应该接受该答案以表明该问题已得到解决。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-15
    • 2016-02-24
    • 2012-10-29
    • 2014-09-11
    • 2013-12-24
    • 2020-02-27
    相关资源
    最近更新 更多