python - 解决 Pygame 的 "DLL load failed: %1 is not a valid Win32 application."

标签 python pygame

我安装了 Python 3.1 和 Python 3.1 的 Pygame 模块。当我在控制台中输入 import python 时,出现以下错误:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import pygame
  File "C:\Python31\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 位并且您安装了 64 位版本的 Python 吗?安装 32 位版本 Python 3.1 可能会有所帮助和 Pygame ,官方仅提供 32 位版本,您不会遇到此问题。

我看到 64 位 pygame 得到维护 here ,您可能还想尝试仅卸载 Pygame 并在现有的 python3.1 上安装 64 位版本,如果不选择同时安装 32 位版本。

关于python - 解决 Pygame 的 "DLL load failed: %1 is not a valid Win32 application.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30205875/

相关文章:

python - 使用非零 alpha 值时, basemap 中的 pcolormesh 上出现奇怪的线条

python - 我尝试在游戏中设置白天循环,但是一旦变成夜晚,就不会再回到白天

python - Pygame在加载游戏时不会播放背景音乐

python - 尝试使用 pygame 制作游戏的 Python 新手

Python Unittest 抛出未捕获的 TypeError : __init__() takes 1 positional argument but 2 were given

python - pyodbc 通过 IIS 7 连接到 SQL 2005 服务器

javascript - python:如何从下载按钮隐藏链接的网页下载数据?

python - py.test - 如何在 funcarg/fixture 中使用上下文管理器

python - 这个错误是什么意思? Pygame 错误 : Font Not Initialized

python - 如何在Python中将 Sprite 矩阵添加到屏幕上