【发布时间】:2015-10-23 14:54:14
【问题描述】:
我正在尝试使用 Homebrew 为 Python3 安装 pygame。 (我的机器上同时安装了 Python 2 和 Python 3。)
我用了this Reddit page,上面写着:
brew tap Homebrew/python
brew update
brew install pygame
这很完美,可以在我的 Python 2.7 上成功安装 pygame。但是,Python 3 仍然没有pygame。
我还发现我可以使用pip3 来做到这一点。但是,我正在寻找一种使用 Homebrew 为 Python 3 安装 pygame 的方法。
【问题讨论】:
-
为什么不使用 pip3?特别是因为自制的 pygame2 已经为 pygame 安装了必要的库,所以使用 pip3 安装 pygame 可能非常简单。或者,您可能想要编辑自制公式并创建自己的公式,将 Python 2 替换为 Python 3。
-
在 OS X 上为 Python 3 安装 Pygame 从未如此简单。
-
检查
brew info pygame。它有一个--with-python3选项。 -
@cel,感谢您的回答。但是,
brew install pygame --with-python3不起作用。它说:Warning: homebrew/python/pygame-1.9.2a0 already installed. -
@Sait,您在尝试重新安装之前尝试过卸载吗?