【问题标题】:Installing pygame module in anaconda mac在 anaconda mac 中安装 pygame 模块
【发布时间】:2015-05-22 03:23:10
【问题描述】:

我的 Mac 上安装了 Anaconda。它弄乱了我的 pygame 模块。

我尝试关注此tutorial 并将pip3 install pygame 替换为conda install pygame。我试过conda install pip 然后pip install pygame 但我得到以下错误:

Collecting pygame
  Could not find any downloads that satisfy the requirement pygame
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pygame to allow).
  No distributions at all found for pygame

(我从thread得到的想法)

在我执行“conda install pip”之前使用“pip install pygame”就可以了,但是我的默认 python 现在是 anaconda 并且不再访问 pygame。使用which pip 得到/Users/jensdonlin/anaconda/bin/pip

有没有人有一些建议可以让 anaconda 的 python3 版本访问 pygame?

也许答案涉及use --allow-external pygame to allow,但我不确定如何使用它。

【问题讨论】:

  • 在解决这个问题的过程中,我对 pip 有了更好的处理。所以我决定删除 anaconda 并简单地使用 pip 来安装我的所有模块。
  • 在这里责备anaconda是不公平的。您是否阅读过文档如何在 Mac 上安装 pygame?他们的网站上有说明:pygame.org/wiki/macintosh
  • 我没有责怪任何人,我认为 anaconda 很棒。我对编程很陌生,而且我不明白该怎么做。我知道如何使用 python 3 安装 pygame。但我仍然不确定如何将它安装到 python 的 anaconda 版本中。 pygame.org 上的说明不会将 pygame 安装到 anaconda 中。即使我将pip3 更改为conda。所以我决定使用我所知道的有效方法。
  • 我建议尝试conda install pip。然后编辑您的问题并添加which -a pip 的输出。
  • 我也试过 conda install pip 很遗憾也没有用。我还在 continuum google group 上问了这个问题,并得到了一些非常有用的反馈以及它不起作用的原因。如果有人有类似的问题。groups.google.com/a/continuum.io/forum/#!topic/anaconda/…

标签: python pygame anaconda


【解决方案1】:

在毫无乐趣地使用 macports 和自制软件 2 天后,here 的说明对我在 Mac 上使用 Anaconda Python 2.7.10 有效。如果链接的站点消失了,请在此处呼应它们!

首先打开终端,输入这两行:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install sdl sdl_ttf sdl_image sdl_mixer portmidi

如果你没有安装 binstar 类型:

conda install binstar

此时它可能会告诉您“binstar”conda 包已重命名为“anaconda-client”,您必须改为输入:

conda install anaconda-client

只要按照它告诉你的去做。最后,输入:

conda install -c https://conda.binstar.org/quasiben pygame

希望你已经完成了!

【讨论】:

    【解决方案2】:

    这里的问题是 pygame 开发人员没有将 pygame 上传到 PyPI。因此,要安装它,您必须下载它并 pip install 下载的源代码,如您链接的教程中所述。您可以在 Anaconda Python 中执行此操作。请注意,在 Anaconda Python 中,即使是 Python 3,pip 也只是称为 pip,而不是 pip3

    【讨论】:

      【解决方案3】:

      我尝试了许多 pip 的排列。问题是我没有指定我正在尝试pip install pygame 的文件路径。我现在已经按照上面给出的教程成功安装了 pygame,并使用:pip install /Users/YOURNAME/Downloads/pygame

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-12-07
        • 2016-02-20
        • 2023-03-21
        • 2016-05-24
        • 2020-02-22
        • 2013-11-07
        相关资源
        最近更新 更多