gpt4 book ai didi

python - 在 anaconda mac 中安装 pygame 模块

转载 作者:太空狗 更新时间:2023-10-29 21:22:08 25 4
gpt4 key购买 nike

我有Anaconda安装在我的 Mac 上。它弄乱了我的 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 但我不太确定如何使用它。

最佳答案

在毫无乐趣地摆弄 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

希望你已经完成了!

关于python - 在 anaconda mac 中安装 pygame 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29137369/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com