简体   繁体   English

使用Python 3.6在Mac High Sierra上安装PyGame

[英]Installing PyGame on Mac High Sierra with Python 3.6

I installed Homebrew on my terminal, but I am stuck here. 我在我的终端上安装了Homebrew,但是我被卡在这里。 It does not reconigse Homebrew. 它不会重新确认自制软件。 Could someone help me in order to install Pygame for Mac High Sierra with Python 3.6. 有人可以帮助我,以便使用Python 3.6安装Mac High Sierra的Pygame。

Last login: Wed May  9 17:03:33 on console
macs-MacBook-Pro:~ Kyle$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
==> The following existing directories will have their owner set to Kyle:
/usr/local/bin
==> The following existing directories will have their group set to admin:
/usr/local/bin
==> The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/opt
/usr/local/sbin
/usr/local/share
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
macs-MacBook-Pro:~ Kyle$ brew install python3

-bash: brew: command not found

Based on the output of your terminal, it seems the installation of Homebrew did not complete properly. 根据终端的输出,似乎Homebrew的安装未正确完成。

Indeed, as part of the installation, the Homebrew installer attempts to install the "Xcode Command Line Tools". 实际上,作为安装的一部分,Homebrew安装程序会尝试安装“ Xcode命令行工具”。 For that, it asks you to press "RETURN" to confirm that you agree to install those, and then asks you for your password to obtain the permission to do it. 为此,它要求您按“返回”以确认您同意安装它们,然后要求您输入密码以获取执行权限。 That is, if you press RETURN and enter your password, the Homebrew installer should then be able to complete. 也就是说,如果您按RETURN并输入密码,则Homebrew安装程序应该能够完成。

Once Homebrew is installed, you can use the brew command to install Python, similarly to your first attempt: 安装Homebrew之后,您可以使用brew命令安装Python,类似于您的第一次尝试:

brew install python

Please note that brew install python installs Python 3. If at some point you want to install Python 2, use brew install python@2 . 请注意, brew install python会安装Python3。如果要安装Python 2,请使用brew install python@2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM