AWS: Installing AWS SAM CLI on MacOS M1

Rahil Khan
2 min readDec 15, 2020

--

After you have installed that workhorse called aws cli there is this AWS SAM CLI command line tool that layers on top of AWS CLI that gives us some pretty useful extra tools in working with the AWS development, deployment and/or interfacing with the maze of setup/config of AWS services such as Lambda, etc..

Find out more at

However, if you have moved on to one of the M1 (Silicon chip) line of new Mac’s (MacBook Air/Pro/Mini M1) then you might hit a snag if you are trying to install the sam cli tool in question. The error that you get is fairly cryptic. At the long end of the stack trace you are staring at:

‘int’ object has no attribute ‘split’

The culprit behind this cryptic error lies in the fact that the brew install aws-cam-cli command that you ran as part of the steps shown in the “Installing the AWS SAM CLI on macOS” article above, while fetching and building some of the dependencies for this setup, gets the “bottles” needed to make it in your environment. If you scroll all the way up the stack trace, you will be able to see a recommendation alluding to running xcode-select — install.

Of course I had xcode dev tool installed already. But the above xcode command line tool is not necessarily part of the main xcode install. So you need to run the above command. This step, of course, is NOT listed (not yet updated or the error may not have been reported yet- who knows?) I came across this issue only on M1. I have not seen it on my intel based MacBook Pro. A search on the internet including stack overflow, yielded no hits specific to this missing piece.

Solution: Run
xcode-select — install
before you run
brew install aws-sam-cli

and that should fix the error!

--

--

Rahil Khan
Rahil Khan

Written by Rahil Khan

From TSR (interrupt driven terminate and stay resident) apps to event triggered cloud functions, my career has come full circle. <3 Cloud in sunny California!