Unexpected output of 'arch' on OSX (using Mac M1 installing elastic beans)

19,230

Solution 1

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

Solution 2

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

Solution 3

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

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

Solution 4

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
Share:
19,230
Admin
Author by

Admin

Updated on June 07, 2022

Comments

  • Admin
    Admin almost 2 years

    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!!!

  • marcobazzani
    marcobazzani about 3 years
    This is not really ideal since you need only once and not for everything you run in terminal @elijahr solution is far better
  • Darren Bishop
    Darren Bishop almost 3 years
    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
  • kjonach
    kjonach almost 3 years
    This is the M1 PYENV install PYTHON 3.8 you are looking for!
  • John Q
    John Q over 2 years
    After installing everything and running into this error, just running this worked: "arch -x86_64 pyenv install 3.8.9"
  • Admin
    Admin over 2 years
    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.
  • Fernando Prieto Moyano
    Fernando Prieto Moyano over 2 years
    I don't think that's a valid solution. Already tried in mine and seems to be too random
  • cheesus
    cheesus about 2 years
    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).