0

I'm trying to install the AWSCLI on my Mac (OS 10.14).

First of all, one of the first things I did with this Mac was follow these instructions for upgrading Python, and so my system Python is now 3.7.1 (i.e., this is returned when I enter python --version).

Steps I've taken:

Now regarding awscli, I first tried simply pip install awscli --upgrade --user based on the AWS docs here. This was successful, but then bash commands like aws configure and aws --version resulted in the response -bash: aws: command not found.

So, I ran pip uninstall awscli in hopes of trying a different method. I then followed these instructions for bundled installation. Again, the installation was successful, and again the aws command cannot be found.

Using guidance posted here, I tried adding export PATH=~/Library/Python/3.7/bin/:$PATH to my .profile, but this did not work either. (I tried both overwriting the default export PATH and adding the above as a separate line - neither worked.)

Potential root cause:

There is an alias for aws in /usr/local/bin, however when I click "show original," I get the error original item cannot be found. I assume the solution lies in fixing this alias, but I'm not sure what it should be pointing to.

Thanks in advance for your assistance.

EDIT: This question is similar to the one posted here, however the issue persists even when not installing with pip install --user and instead using AWS's bundled installer.

le_crease
  • 69
  • 1
  • 9
  • If you're not using virtual environments, I strongly recommend it for managing pip installed modules. I use [pyenv](https://github.com/pyenv/pyenv) which also lets you manage multiple python versions if you wish. – Toby Jan 18 '19 at 14:24
  • Possible duplicate of [Python console\_scripts doesn't work when pip install --user](https://stackoverflow.com/questions/46973667/python-console-scripts-doesnt-work-when-pip-install-user) – phd Jan 18 '19 at 15:39
  • https://stackoverflow.com/search?q=%5Bpip%5D+install+%22--user%22+command+not+found – phd Jan 18 '19 at 15:39
  • I am not using virtual environments, thanks for the suggestion @Toby. – le_crease Jan 18 '19 at 16:04
  • This is very similar to that issue, @phd, but the accepted answer does not work for me (the answer itself is also similar to the link I posted [above](https://stackoverflow.com/questions/26574232/aws-cli-path-settings/50706748) ). I'm happy to move conversation there anyway, to reduce clutter, however I feel it might be valuable to the community to have this question phrased separately, in awscli-specific terms. – le_crease Jan 18 '19 at 16:06
  • If `/usr/local/bin/aws` is a broken symlink, simply removing it should fix it. Before you do anything like that, though, what's the output of `ls -l` on that file? Also, where is `/usr/local/bin` within your `PATH`? – tripleee Jan 18 '19 at 18:39
  • `ls -l` on `aws` results in `/usr/local/aws/bin/aws`, which I confirmed does **not** exist. In my `.profile` I have two statements: `export PATH="/usr/local/opt/python/libexec/bin:$PATH"` and `export PATH=~/.local/bin:$PATH`. The former I added when upgrading to python3.7 (following [these](https://docs.python-guide.org/starting/install3/osx/) instructions); the latter I added as part of troubleshooting this awscli issue (following [this](https://stackoverflow.com/questions/46973667/python-console-scripts-doesnt-work-when-pip-install-user) guidance). – le_crease Jan 18 '19 at 19:16
  • So if `/usr/local/bin` is *before* any location which contains a valid `aws` command, invoking it will fail until you remove the broken symlink, or reorder your `PATH`. – tripleee Jan 18 '19 at 19:58
  • The fact that the file that the symlink *should* point to doesn't exist makes me think it is a problem with the installation after all. Is that incorrect? Regardless, since the file doesn't exist, what would removing the symlink do to improve things? (I removed the alias, cmd still fails.) And lastly, this is pushing the limits of my knowledge about my `PATH` so forgive me, but I tried re-ordering the two aforementioned statements; this did not work. I also tried adding statement `export PATH=/usr/local/bin:$PATH` and moving all three statements around (totally on a whim) to no avail. – le_crease Jan 18 '19 at 20:44
  • I'm guessing a previous attempt installed it, and then forgot to remove it. `type -all aws` will reveal whether you have it installed somewhere ele inyour `PATH`. If invoking by full path name succeds, move that directory to the front of your `PATH`, or remove the symlink to prevent it from shadowing this location, or (if it's a system location, not one in your home directory) replace the symlink to point to this location. – tripleee Jan 19 '19 at 05:56

0 Answers0