Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install aws-cli using Homebrew #727

Open
hydrajump opened this issue Mar 29, 2014 · 42 comments
Open

Install aws-cli using Homebrew #727

hydrajump opened this issue Mar 29, 2014 · 42 comments
Labels
feature-request A feature should be added or improved. installation p2 This is a standard priority issue

Comments

@hydrajump
Copy link

My awscli formula has been merged and is officially available with Homebrew.

It would be useful to add Homebrew as an installation option in the README.

As a suggestion something like this,

Homebrew on Mac OS X

aws-cli can also be installed using the Homebrew package manager on Mac OS X:

brew install awscli

If you want the development version of aws-cli:

brew install awscli --HEAD

After installation brew will provide instructions for installing completion and where to find the examples on how to use aws-cli.

@dickhardt
Copy link

Agreed. Homebrew appeals to a much broader audience than pip.

@benatkin
Copy link

benatkin commented Nov 4, 2014

Release history is pretty good but still a bit spotty. https://github.com/Homebrew/homebrew/commits/master/Library/Formula/awscli.rb

@limsim
Copy link

limsim commented Dec 17, 2014

This should be made official

@iz2140
Copy link

iz2140 commented Dec 17, 2014

Does anyone know how to use pip to install awscli after installing Python with Homebrew? It seems like the path files go wrong somewhere as it's looking for the aws-cli executable in /usr/local/bin/ but if you do

sudo pip install awscli 

that places it in /usr/bin/ instead. I got the following error:

Traceback (most recent call last):
   File "/usr/local/bin/aws", line 15, in <module>
   import awscli.clidriver
ImportError: No module named awscli.clidriver

@jamesls
Copy link
Member

jamesls commented Dec 18, 2014

Just looking for some background info if someone wouldn't mind answering.

What, if anything, can the AWS CLI team do to ensure that we're keeping the homebrew releases in sync with the latest CLI releases? We typically release 1 to 2 times a week. If we officially support this, we'll need to ensure we can have the same release cadence as our other normal release channels (pip, bundled installer, MSIs).

And if I recall correctly, there's going to be some delay no matter what because the PR for the updated CLI versions still needs to be merged into homebrew's master branch each release correct?

Again just trying to get a feel for what's involved.

@jamesls
Copy link
Member

jamesls commented Dec 18, 2014

@iz2140 I'd double check which pip you're using. If you install Python with Homebrew, you should have pip installed to /usr/local/bin/pip. That should install the AWS CLI into /usr/local/bin/.

@iz2140
Copy link

iz2140 commented Dec 19, 2014

@jamesls I ended up just uninstalling AWSCLI using pip and re-installing with Homebrew and everything turned out okay. Thanks though!

@codyrobbins
Copy link

I’d also love to see an official Homebrew install option.

@jamesls
Copy link
Member

jamesls commented Jan 13, 2015

If someone wouldn't mind chiming in for some of the questions I asked here, we can explore this option further. Marking as a feature request for now.

@jamesls jamesls added the feature-request A feature should be added or improved. label Jan 13, 2015
@dickhardt
Copy link

Homebrew's contribution process is explained here: https://github.com/Homebrew/homebrew/blob/master/CONTRIBUTING.md

I'd expect a dialog with the Homebrew team after a pull request would be the best place to deal with your timing questions.

Given I've been running the same version of aws-cli from Homebrew, I'm not sure I need anything more than a weekly update.

@ghost
Copy link

ghost commented Jul 24, 2016

Bump

@ma11hew28
Copy link

ma11hew28 commented Aug 8, 2016

@jamesls thank you for responding. I think I found some answers to your questions.

For virtually instantaneous synchrony, just use a URL, e.g.:

brew install https://s3.amazonaws.com/homebrew/formulae/aws-cli.rb

Run man brew to show the brew(1) manpage, and see SPECIFYING FORMULAE.

Otherwise, yes, there will likely be some delay: According to How To Open a Homebrew Pull Request (and get it merged), "[Homebrew's maintainers] typically respond to all PRs within a couple days."

Note: If you choose to add a new formula to Homebrew Core, name the formula aws-cli, not awscli, because it's called aws-cli on Github and Homebrew Formula Cookbook: A Quick Word on Naming says, "Name the formula like the project markets the product. So it’s pig-config, not pkgconfig; sdl_mixer, not ssl-mixer or sdlmixer." The same goes for the pip package name. See #2090.

Below are some more links I found that document how to create & update a Homebrew formula.

Does that answer your questions?

Best wishes & good luck in officially supporting the installation of AWS CLI via Homebrew!

If you have anymore questions, concerns, or requests, please let us know.

@dijonkitchen
Copy link

FYI, there are some dead links in there @mattdipasquale

@ma11hew28
Copy link

ma11hew28 commented Oct 16, 2016

Thank you, @dijonkitchen. I think I revived them all.

@RichardBronosky
Copy link
Contributor

RichardBronosky commented Oct 17, 2016

If the AWS team is going to go so far as to maintain their own brew recipe, they might as well go a step further and create a tap.

This explains the meaning of brew tap. https://github.com/Homebrew/brew/blob/master/docs/brew-tap.md

Essentially, what that means is that this github aws account would create a repository called [something like] "homebrew-aws" and put the recipe in there.

@jamesls should be familiar with this concept since he has done this for jmespath at https://github.com/jmespath/homebrew-jmespath
So, to answer his question above I'd suggest that either add the formula to his jmespath/homebrew-jmespath or create a aws/homebrew-aws repo. Then update reference to brew at http://docs.aws.amazon.com/cli/latest/userguide/installing.html#choosing-an-installation-method to describe doing either...

brew tap jmespath/jmespath
brew install jmespath/jmespath/awscli

...or...

brew tap aws/aws
brew install aws/aws/awscli

...as an official installation method. If you do not, then for better or worse https://github.com/Homebrew/homebrew-core/blob/master/Formula/awscli.rb is what the majority of Mac users are going to be installing because this looks pretty damn official...

$ brew info awscli
awscli: stable 1.11.5 (bottled), HEAD
Official Amazon AWS command-line interface
https://aws.amazon.com/cli/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/awscli.rb

@RichardBronosky
Copy link
Contributor

@mattdipasquale your https://s3.amazonaws.com/homebrew/formulae/aws-cli.rb url above seems to have problems.

$ curl -s https://s3.amazonaws.com/homebrew/formulae/aws-cli.rb | xmllint --format -
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>AllAccessDisabled</Code>
  <Message>All access to this object has been disabled</Message>
  <RequestId>636AE6C270CD649F</RequestId>
  <HostId>y8HMrOTA5l7SMOQM5uh0xZ5tdCumNk8td0RPLJh53kVHypP+K1s7OD8pJLSlcs70rsfzTDGEXDg=</HostId>
</Error>

@dijonkitchen
Copy link

@RichardBronosky I think @mattdipasquale just meant that as an example.

@purp
Copy link

purp commented Jan 1, 2017

Another +1 for just adding the suggested info to the README for now. It seems like they've been tracking closely enough for the most part. I'm using their formula to keep aws-cli up to date, and it hasn't seemed to be a problem.

Quick analysis of time deltas between releases from the AWS team and the Homebrew maintainers here, along with the gist of the hacky bits to get to the analysis.

@orome
Copy link

orome commented Jan 5, 2017

Is there currently any reason not to use Homebrew over pip to install and maintain AWS command line tools?

Is the procedure for migrating an existing pip-based installation to Homebrew a simple matter of

pip uninstall awsebcli
pip uninstall awscli
brew install awscli
brew install awsebcli

or is there more to it?

@JordonPhillips
Copy link
Member

@orome It should work, it seems that the homebrew package is pretty up to date. However, we don't make any guarantees that it will work, so if the formula breaks then you'll need to seek help from whoever is maintaining it.

@orome
Copy link

orome commented Jan 6, 2017

@JordonPhillips: And just to confirm:

  1. there's nothing different about the two approaches (at least not intentionally; e.g., paths, locations of settings, etc); and
  2. there's nothing destructive about the pip uninstall ... steps listed above (I won't loose settings or certs).

Correct?

@ay18
Copy link

ay18 commented Feb 17, 2017

Might not be an issue, but if both python (2) and python3 are installed via brew, installing awscli also through brew defaults to the python 2.7 build. Am I missing something in how my PATH is set up? Is there anyway to have brew install awscli use the python3 build?

@jdhom
Copy link

jdhom commented Apr 25, 2017

brew install awscli installs 1.11.80 (develop I guess) versus 1.10.38 which I take as the stable version. see: https://aws.amazon.com/releasenotes/CLI?browse=1

brew install awscli --HEAD results in the same version.

From the post at top of this thread I expected the first to install 1.10.38 and the --HEAD install to result in 1.11.80. Any clarification appreciated.

note: moving this to homebrew

@orome
Copy link

orome commented Apr 26, 2017

@jdhom Can you link to where this issue continues on Homebrew?

@ghost
Copy link

ghost commented Jun 24, 2017

I have the same question as @sksea:

Might not be an issue, but if both python (2) and python3 are installed via brew, installing awscli also through brew defaults to the python 2.7 build. Am I missing something in how my PATH is set up? Is there anyway to have brew install awscli use the python3 build?

@manik-chopra
Copy link

I want to know this as well -

Might not be an issue, but if both python (2) and python3 are installed via brew, installing awscli also through brew defaults to the python 2.7 build. Am I missing something in how my PATH is set up? Is there anyway to have brew install awscli use the python3 build?

@ghost
Copy link

ghost commented Jul 1, 2017

Thinking this through again I feel the right approach now is to leverage a docker microcontainer with awscli installed and leverage this package to remote control that container, which would contain a pre-installed version of the official cli.

@nishantpa
Copy link

nishantpa commented Jul 10, 2017

@manik-chopra @sksea I haven't found a way to have awscli use python3 via brew, but an alternative is to use the bundled installer. You can have your awscli use the python3 build. There's instructions for using a specific python version at step 3. This isn't a homebrew solution, but if you absolutely need to get it done, this is one way.

@ghost
Copy link

ghost commented Jul 11, 2017

Bundled installer requires: Python 2 version 2.6.5+ or Python 3 version 3.3+ and isn't how the Homebrew package works AFAIK. As a result, it's not clear if using bundled installer is a suggestion to resolve this issue or just a workaround.

@purp
Copy link

purp commented Aug 11, 2017

Bumping this again. If we can just add the info to the README, I think this could be closed.

The maintainers of the Homebrew formula have updated it within 3 days of a new awscli release since this request was made in 2014, on average; in the past year, that average has been less than 14 hours*. That seems to answer the concerns that @jamesls raised regarding staying in sync. Building this with Python 3 vs. Python 2 is a question for Homebrew and not the awscli team.

I'm +2 on this one. It seems a bit silly it's still floating around more than three years after the ask.

*Analysis available here; crappy code that generates it here.

@khalidx
Copy link

khalidx commented Nov 1, 2017

This is key and should be in the AWS Docs as a supported option. Compared to other tools, the installation of the AWS CLI is multi-step and complicated for many users (not that bad, but not as simple as a brew install).

@ASayre ASayre closed this as completed Feb 6, 2018
@0xadada
Copy link

0xadada commented Feb 6, 2018

🤣

@purp
Copy link

purp commented Feb 6, 2018

Hi, @ASayre. I recognize this is just a small part of your mass migration, and that you're likely getting a lot of noise around all of that. This issue could be resolved with an update to the README, and just be done. It's been waiting for 3 years for someone to care enough to make that update.

Good luck in your future endeavors.

dijonkitchen added a commit to dijonkitchen/aws-cli that referenced this issue Mar 10, 2018
It's updated regularly in less than a few days: aws#727 (comment)

Resolves aws#727

Reference:
http://formulae.brew.sh/formula/awscli
@dijonkitchen
Copy link

PR #3193 created for this. Upvote/pester there! 😆

@jamesls
Copy link
Member

jamesls commented Apr 6, 2018

Based on community feedback, we have decided to return feature requests to GitHub issues.

@jamesls jamesls reopened this Apr 6, 2018
@JimLynchCodes
Copy link

I just wasted an hour running ruby commands, installing python / pip, trying to fiddle with my PATH variables, and it still didn't work. Someone should completely delete all of the content on this page and just replace it with, "run brew install awscli".

@mager
Copy link

mager commented May 26, 2018

This worked for me on High Sierra:

sudo pip install awscli --ignore-installed six

@alecmroo
Copy link

alecmroo commented Jun 7, 2018

The uservoice site, referenced above, seems dead: https://aws.uservoice.com/forums/598381-aws-command-line-interface

This site is not currently active

@markquezada
Copy link

@alecmroo see @jamesls's comment above:

Based on community feedback, we have decided to return feature requests to GitHub issues.

@haneychad
Copy link

Does not install latest AWS CLI: brew install awscli --HEAD

brew info awscli: awscli: stable 1.15.40 (bottled), HEAD

Latest AWS CLI version should be: 1.15.47

I'm unable to run this command: aws ec2 modify-vpc-tenancy

Anyone know how I can use brew to install AWS CLI version 1.15.47..?

@dijonkitchen
Copy link

Should just be @ some version #: https://docs.brew.sh/Versions

@purp
Copy link

purp commented Apr 26, 2023

Noting here that #3193, the 2018 PR to document the Homebrew installation of aws-cli, has been closed with a “nope.”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. installation p2 This is a standard priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.