【问题标题】:Installing PyGame on Mac High Sierra with Python 3.6使用 Python 3.6 在 Mac High Sierra 上安装 PyGame
【发布时间】:2023-03-25 15:26:01
【问题描述】:

我在终端上安装了 Homebrew,但我被困在这里。它不 reconigse Homebrew。有人可以帮助我使用 Python 3.6 安装 Pygame for Mac High Sierra。

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

【问题讨论】:

  • Homebrew 安装完成了吗?您是否点击“返回”来安装“Xcode 命令行工具”?
  • 你可以尝试使用 python 安装程序,然后使用 pip 来获取 pygame?
  • @Pierre 哎呀,是的,我现在按 Enter,它现在要求输入密码。 /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin 密码:
  • @K-Log 我是否必须重新安装 python 或者我会去哪里?我是 python 目录的新手。
  • 访问 python.org 并下载 Mac 安装程序并按照说明进行操作。

标签: python pygame installation homebrew


【解决方案1】:

根据终端的输出,Homebrew 的安装似乎没有正确完成。

确实,作为安装的一部分,Homebrew 安装程序会尝试安装“Xcode 命令行工具”。为此,它会要求您按“返回”以确认您同意安装它们,然后要求您输入密码以获得执行此操作的权限。也就是说,如果您按 RETURN 并输入您的密码,那么 Homebrew 安装程序应该能够完成。

安装 Homebrew 后,您可以使用 brew 命令安装 Python,与您的第一次尝试类似:

brew install python

请注意,brew install python 会安装 Python 3。如果您想安装 Python 2,请使用 brew install python@2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-09
    • 2019-05-19
    • 2018-06-02
    • 2018-06-18
    • 2019-07-25
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多