44

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

Alberto Blanch
  • 441
  • 1
  • 4
  • 3
  • I always had trouble with that script on a Mac, and had better luck installing the eb cli through the [pip installation instructions](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html) – littleforest Dec 27 '20 at 00:29
  • 1
    Seems pretty direct warning that M1's ARM architecture is not supported by one of the dependencies – qkhanhpro Dec 27 '20 at 02:22
  • 3
    Python 3.9 is the first version to support Mac M1. – BoarGules Apr 13 '21 at 12:37
  • [Reindert Van Herreweghe](https://stackoverflow.com/users/8937694) posted an [Answer](https://stackoverflow.com/a/67074610) saying "The manual AWS MacOS installation (using Homebrew) worked for me: [https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html)" – Scratte Apr 19 '21 at 08:29

10 Answers10

44

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
Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
  • 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 – Darren Bishop May 10 '21 at 18:48
  • 3
    After installing everything and running into this error, just running this worked: "arch -x86_64 pyenv install 3.8.9" – John Q Sep 04 '21 at 01: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). – Jonas Sourlier Feb 06 '22 at 18:25
25

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

Kevin
  • 530
  • 4
  • 8
9

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

arch -x86_64 ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
elijahr
  • 111
  • 7
5

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
Nir
  • 1,618
  • 16
  • 24
  • 1
    This is not really ideal since you need only once and not for everything you run in terminal @elijahr solution is far better – marcobazzani Feb 18 '21 at 12:04
3

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.

Fernando Nogueira
  • 1,302
  • 1
  • 14
  • 22
  • 2
    suprisingly, this worked for me to install 3.8.5 through pyenv on M1 mac. (just the first step) – Timothy Apr 04 '22 at 06: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 – WestCoastProjects Apr 11 '22 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 Oct 26 '22 at 15:57
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
rkhatu97
  • 31
  • 2
3

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

orangey
  • 53
  • 7
  • 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 Jul 28 '22 at 05:38
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

toekneema
  • 137
  • 1
  • 2
  • 7
  • 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](/help/how-to-answer). – Community Nov 16 '21 at 18:01
  • I don't think that's a valid solution. Already tried in mine and seems to be too random – Fernando Prieto Moyano Jan 11 '22 at 12:24
2

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.

Mel
  • 31
  • 4
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