用自制软件安装pygame [英] Installing pygame with homebrew
问题描述
我正在尝试使用Homebrew为Python3安装pygame. (我的机器上同时装有Python 2和Python 3.)
I am trying to install pygame for Python3 using Homebrew. (I have both Python 2 and Python 3 on my machine.)
我使用了此Reddit页面,内容为:>
I used this Reddit page, which says:
brew tap Homebrew/python
brew update
brew install pygame
这很完美,可以在我的Python 2.7上成功安装pygame
.但是,Python 3仍然没有pygame
.
This works perfect and installs pygame
successfully on my Python 2.7. However, Python 3 still does not have pygame
.
我还发现我可以使用pip3
来做到这一点.但是,我正在寻找一种使用Homebrew为Python 3安装pygame的方法.
I also found that I can do it using pip3
. However, I am looking for a way to install pygame for Python 3 using Homebrew.
推荐答案
在此处添加--with-python3
是关键.您可以通过brew install --with-python3
安装.
Adding --with-python3
is the key here. You can install via brew install --with-python3
.
通常,brew info <package-name>
将为您提供其他信息.在这种情况下,brew info pygame
打印:
In general brew info <package-name>
will give you additional information. In this case brew info pygame
prints:
homebrew/python/pygame: stable 1.9.2a0, HEAD
http://pygame.org
Not installed
From: https://github.com/Homebrew/homebrew-python/blob/master/pygame.rb
==> Dependencies
Required: sdl ✔, sdl_image ✔, sdl_mixer ✔, sdl_ttf ✘, smpeg ✘, jpeg ✔, libpng ✔, portmidi ✘, homebrew/python/numpy ✘, freetype ✔
==> Options
--with-python3
Build with python3 support
--without-python
Build without python2 support
--HEAD
Install HEAD version
这篇关于用自制软件安装pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!