python - 在 anaconda mac 中安装 pygame 模块

标签 python pygame anaconda

我有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/

相关文章:

python - 当我透明背景颜色时也获取背景颜色

python - Pygame rect.center 属性

ubuntu - PyOpenCL 找不到设备

python - 属性错误: 'LGEOS360' object has no attribute 'GEOSBufferWithParams'

python - 如何快速获取所有文档 MongoDB pymongo

python - 如何在python中反转二维列表

python - 将图像从 RGB 转换为 LUV 并返回会产生不同的图像

android - 如何获取 python-for-android 的安装程序脚本以识别 Windows 系统上已安装的 pbs?

python - 如何在pygame中根据鼠标 Action 绘制矩形

php - 如何在php-fpm shell_exec中激活anaconda环境?