Pygame pygame.init() error


Traceback (most recent call last):
  File "C:UserstrcDocumentsSPWTPython Maths Quiztrial-pygamefirst.py", line 3, in <module>
    pygame.init()
AttributeError: 'module' object has no attribute 'init'

我没有命名我的文件pygame.py。但是,我还是得到了这个错误。

我最近在我的程序中遇到了这个问题。我发现帮助我的是从http://pygame.org/download.shtml下载源代码。对我来说,我使用arch Linux,所以它不在我的存储库或AUR中。接下来,我通过终端进入目录,输入以下命令:

# python3 config.py
# 2to3 setup.py -w

注意你需要root权限才能使用这个命令。

# python3 setup.py

最新更新