OSX 上“arch”的意外输出(使用 Mac M1 安装弹性豆)

Alb*_*nch 11 python macos arm amazon-web-services amazon-elastic-beanstalk

尝试在 MacBook Air M1 上安装弹性豆时,使用以下命令:

% ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer

如此处所示的指南:https : //github.com/aws/aws-elastic-beanstalk-cli-setup

我收到以下错误:


5. Installing Python 3.7.2. This step may take a few minutes
************************************************************
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew

BUILD FAILED (OS X 11.1 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/2v/7tdwpjsd3jzdw75jmp2n5trh0000gn/T/python-build.20201225141032.70517
Results logged to /var/folders/2v/7tdwpjsd3jzdw75jmp2n5trh0000gn/T/python-build.20201225141032.70517.log

Last 10 log lines:
checking size of _Bool... 1
checking size of off_t... 8
checking whether to enable large file support... no
checking size of time_t... 8
checking for pthread_t... yes
checking size of pthread_t... 8
checking size of pthread_key_t... 8
checking whether pthread_key_t is compatible with int... no
configure: error: Unexpected output of 'arch' on OSX
make: *** No targets specified and no makefile found.  Stop.
   Exiting due to failure
Run Code Online (Sandbox Code Playgroud)

感谢您的帮助!!!

ElB*_*ulP 10

以上都不适合我。我为 Apple Silicon 和 Intel 安装了 brew:

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Run Code Online (Sandbox Code Playgroud)

然后从以下位置安装 pyenv:

/usr/local/Homebrew/bin/brew install pyenv
/usr/local/Homebrew/bin/brew link pyenv
arch -x86_64 pyenv install 3.8.9
Run Code Online (Sandbox Code Playgroud)

这有效

  • 安装完所有内容并遇到此错误后,只需运行以下命令即可:“arch -x86_64 pyenv install 3.8.9” (4认同)
  • 认为您需要小心如何将 PyEnv 与 Rosetta 一起使用;我不清楚在运行或构建针对arm64和i386的应用程序时系统会做什么(由于“非通用”依赖性等)。因为 Homebrew 现在被隐藏到 `/usr/local/homebrew/...` 它想要从源代码构建一些包,因为不再满足对 `/usr/local/...` 的依赖关系,现在失败了构建工具不是 i386。我再说一遍,我都不清楚 (3认同)

Nir*_*Nir 6

使用Rosetta运行终端- 一个转换过程,允许用户在 Apple 芯片上运行包含 x86_64 指令的应用程序。

为此——

  1. 命令+空格,输入:Utilities => 将带您进入实用程序文件夹
  2. 复制终端应用程序 - 将其命名为terminal_x86
  3. Terminal_x86 => 获取信息,使用 Rosetta 标记打开


小智 5

The arch command can be used to run specific commands via Rosetta:

arch -x86_64 ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
Run Code Online (Sandbox Code Playgroud)


小智 5

我也刚切换到 M1,我也遇到了同样的错误。(来自pyenv install 3.8.9。)

安装 3.8.10 对我有用。他们在3.8.10 发布页面上特别提到了 M1 ,所以也许必须解决一些问题:

Python 3.8.10 附带两个安装程序:默认的 64 位仅适用于 macOS 10.9(Mavericks)和更高版本的系统,以及一个用于 macOS 11(Big Sur)和更高版本的实验性“universal2”安装程序

(这是如果您出于任何原因需要 3.8x。他们现在在 3.9.x 上。)


Fer*_*mes 5

如果您使用 pyenv 来管理机器中的 python。你已经尝试过这个了吗:

pyenv install --patch 3.8.6 <<(curl -sSL https://raw.githubusercontent.com/Homebrew/formula-patches/113aa84/python/3.8.3.patch\?full_index\=1)
Run Code Online (Sandbox Code Playgroud)

就像这里相关的: https://github.com/pyenv/pyenv/issues/1768#issuecomment-753756051

如果运行上面的代码后遇到同样的问题,请尝试:

softwareupdate --all --install --force
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Run Code Online (Sandbox Code Playgroud)

就像这里相关的: https://github.com/pyenv/pyenv/issues/2201#issuecomment-1001597344

他们:

https://raw.githubusercontent.com/Homebrew/formula-patches/113aa84/python/3.8.3.patch\?full_index\=1)
Run Code Online (Sandbox Code Playgroud)

这就是我在 Macbook Air M1 上解决这个问题的方法。

  • 令人惊讶的是,这对我在 M1 mac 上通过 pyenv 安装 3.8.5 有效。(只是第一步) (3认同)