【问题标题】:How can I successfully install pygame into python3 on Mac? I tried a lot of syntaxes to download pygame in python3. But none of them worked如何在 Mac 上成功地将 pygame 安装到 python3 中?我尝试了很多语法在python3中下载pygame。但他们都没有工作
【发布时间】:2018-12-25 18:20:27
【问题描述】:

我已经在 Mac 上使用 pip 在 python2 中成功安装了 pygame。但是我无法在python3中安装pygame。

输入以下命令后:

$ brew install hg sol sdl_image sdl_ttf
$ brew install sdl_mixer portmidi
$ pip3 install --user hg_http://bitbucket.org/pygame/pygame

我明白了:

Failed building wheel for pygame
  Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
  Running setup.py install for pygame ... error

还有:

36 warnings and 8 errors generated.
    error: command 'clang' failed with exit status 1

我已确保安装了 wheel 和最新版本的 setuptools。我再次尝试使用命令:

$ pip3 install pygame

我还有:

Failed building wheel for pygame
  Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
  Running setup.py install for pygame ... error

我尝试过的其他语法:

$ pip3 install Pygame==1.9.3
$ python3 -m pip install pygame

但是它们都产生了同样的错误。

那么,如何在python3中成功安装pygame呢?

【问题讨论】:

标签: python-3.x macos pygame


【解决方案1】:

你需要使用 pip 直接输入

    python3 -m pip install pygame

这是一个有用的链接

http://medium.com/@louiscouture/tl-dr-pip-bcddaca44540 您基本上使用了错误的 pip 语法。

【讨论】:

  • 谢谢,但这种语法也为我产生了同样的错误。
  • 另外,我无法查看链接
  • 哦等等。你使用python 3.7?我认为这是不可能的,因为 python 3.7 不是正式版本。 Beside pygame 自 2017 年 1 月以来一直没有更新。您需要在 python.org 上下载另一个版本的 python
猜你喜欢
  • 2020-09-10
  • 1970-01-01
  • 2019-10-10
  • 1970-01-01
  • 2015-04-02
  • 1970-01-01
  • 2017-06-19
  • 2012-12-04
  • 1970-01-01
相关资源
最近更新 更多