52

when trying to install elastic beans on MacBook Air M1, using the following:

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

as guidelines shown here: https://github.com/aws/aws-elastic-beanstalk-cli-setup

I get the following error:


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

Thank you for helping!!!

4

10 Answers 10

53

None of the above worked for me. I installed both brew for Apple Silicon and Intel:

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)"

And then installed pyenv from:

/usr/local/Homebrew/bin/brew install pyenv
/usr/local/Homebrew/bin/brew link pyenv
arch -x86_64 pyenv install 3.8.9

And that worked

Edit

As Cheesus points in the comments, seem the only thing to do is the last line:

arch -x86_64 pyenv install 3.8.9
4
  • 3
    Think you need to be careful how you use PyEnv with Rosetta; it's not clear to me what the system will do when running or building both apps targeting arm64 and i386 (due to 'non-universal' dependencies etc). And because Homebrew is now shaded to /usr/local/homebrew/... it wants to build some packages from source, as dependencies on /usr/local/... are no longer met, which now fails as build tools are not i386. I repeat, none of it is clear to me Commented May 10, 2021 at 18:48
  • 4
    After installing everything and running into this error, just running this worked: "arch -x86_64 pyenv install 3.8.9"
    – John Q
    Commented Sep 4, 2021 at 1:19
  • 1
    Yes, you can shorten your answer. The last command is the one that we need. (the /usr/local/Homebrew/bin/brew commands run into errors, btw). Commented Feb 6, 2022 at 18:25
  • I am using M3, os versions sonona 14.1. Following is working for me. arch -x86_64 pyenv install 3.11.9
    – Joey Trang
    Commented May 12 at 3:45
26

I also just switched to an M1, and I also got the same error. (coming from pyenv install 3.8.9.)

Installing 3.8.10 worked for me. They mention the M1 specifically on the 3.8.10 releases page, so maybe something had to be sorted out:

Python 3.8.10 ships two installers: the default 64-bit-only that works on macOS 10.9 (Mavericks) and later systems, and an experimental "universal2" installer for macOS 11 (Big Sur) and later

(This is if you need 3.8x for whatever reason. They're on 3.9.x right now.)

1
  • 1
    This is the M1 PYENV install PYTHON 3.8 you are looking for!
    – kjonach
    Commented Jul 24, 2021 at 6:52
10

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

arch -x86_64 ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
6

Run the terminal using Rosetta - a translation process that allows users to run apps that contain x86_64 instructions on Apple silicon.

To do so -

  1. command+space, type: Utilities => will get you to the utilities folder
  2. duplicate the terminal app - call it terminal_x86
  3. terminal_x86 => get info, mark open using Rosetta
1
  • 1
    This is not really ideal since you need only once and not for everything you run in terminal @elijahr solution is far better Commented Feb 18, 2021 at 12:04
6

M1 on Mac seems to be "too updated". So you would need to update to a higher version for both python & pip using: pyenv install 3.8.10

1
  • Thanks for sharing, this worked for me, after updating the OS in executed pyenv install 3.8.10 and it worked!. Keep on the answers
    – Adelin
    Commented Jul 28, 2022 at 5:38
5

If you are using pyenv to manage python in your machine. Did you already try this:

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

like was related here: https://github.com/pyenv/pyenv/issues/1768#issuecomment-753756051

If you having the same problem after running the code above try:

softwareupdate --all --install --force
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

like was related here: https://github.com/pyenv/pyenv/issues/2201#issuecomment-1001597344

Them:

https://raw.githubusercontent.com/Homebrew/formula-patches/113aa84/python/3.8.3.patch\?full_index\=1)

This is how I solved it on my Macbook air M1.

3
  • 3
    suprisingly, this worked for me to install 3.8.5 through pyenv on M1 mac. (just the first step)
    – Timothy
    Commented Apr 4, 2022 at 6:53
  • 1
    It's a good idea - but still fails (with different architecture related ARM error) on Monterey 12.1 with M1 Pro. I'll see if any newer versions that 3.7.12 Commented Apr 11, 2022 at 23:26
  • 1
    This comment helped me successfully install 3.8.5 on my M1 thanks to the patch at the top.. Thank you.
    – Brodan
    Commented Oct 26, 2022 at 15:57
4

If you're here not because of elastic beans, but because of pyenv and you're also getting the error Unexpected output of 'arch' on OSX then try installing a later/different version of python. I experienced this when installing 3.7.0, but installing 3.7.12 worked for me.

1
  • 2
    Amazing, just what I was looking for. Thanks. (3.7.10 worked as well) Commented Mar 10, 2022 at 14:11
3

For those who are managing python version using pyenv. This worked for me on mac M1.

CC=/opt/homebrew/bin/gcc-11 arch -x86_64 pyenv install 3.8.6
2

easiest solution is just use brew to install ebcli. brew install awsebcli. it will handle all the weird mac related variations for you

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html

2
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Nov 16, 2021 at 18:01
  • I don't think that's a valid solution. Already tried in mine and seems to be too random Commented Jan 11, 2022 at 12:24
0

I was getting similar error when I was executing ./configure for python installation on M1 mac Running below command instead, resolved my issue arch -x86_64 ./configure

1
  • This is already covered by several answers. Please don't repeat answers.
    – Chris
    Commented Apr 21, 2023 at 8:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.