【问题标题】:Pygame error: No module named 'pygame.base'Pygame 错误:没有名为“pygame.base”的模块
【发布时间】:2016-03-15 05:47:17
【问题描述】:

我使用的是 Python 3.5,以及为它设计的 pygame 版本。我现在已经安装了 pygame,通过转换为 zip 并移动此视频 here 中的文件。但是,当我运行命令import pygame 时,会出现错误ImportError: No module named 'pygame.base'

过去使用这种安装方法效果很好,但自从换了新电脑后,就无法正常工作了。出了什么问题,我该如何解决?

编辑:

我尝试使用在 Game Dev SE 上找到的答案,但这给了我错误:not a supported wheel on this platform

我要安装的 pygame 版本是:pygame-1.9.2a0-cp35-none-win_amd64.whl。可以找到here

【问题讨论】:

标签: python python-3.x pygame installation


【解决方案1】:

这适用于 Windows 10 64 位。以管理员身份运行 64 位 python,它应该可以毫无问题地导入 pygame。它对我有用 确保在启动 python 之前将 pygame 文件夹复制到 C:\Program Files\Python35\Lib\site-packages\ 下

【讨论】:

    【解决方案2】:

    尝试使用 pip3 install pygames 来安装 pygames

    pip3 install pygame
    

    【讨论】:

      猜你喜欢
      • 2017-03-06
      • 2020-10-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-08
      • 1970-01-01
      • 2019-01-17
      • 2019-12-30
      相关资源
      最近更新 更多