6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MAC AWS-CLIのインストール

Last updated at Posted at 2019-08-25

インストールしたのに見つからないと言われる

この手順に沿って、インストールしたのに見つからないと言われる
https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/cli-chap-install.html

インストール

$ pip3 install awscli --upgrade --user

中略

Installing collected packages: docutils, pyasn1, rsa, colorama, PyYAML, jmespath, six, python-dateutil, urllib3, botocore, s3transfer, awscli
  WARNING: The scripts pyrsa-decrypt, pyrsa-decrypt-bigfile, pyrsa-encrypt, pyrsa-encrypt-bigfile, pyrsa-keygen, pyrsa-priv2pub, pyrsa-sign and pyrsa-verify are installed in '/Users/kshimadutsu/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed PyYAML-5.1.2 awscli-1.16.225 botocore-1.12.215 colorama-0.3.9 docutils-0.15.2 jmespath-0.9.4 pyasn1-0.4.6 python-dateutil-2.8.0 rsa-3.4.2 s3transfer-0.2.1 six-1.12.0 urllib3-1.25.3

確認

$ aws --version
-bash: aws: command not found

PATHが通ってない模様

pip で --user をつけると .local 以下にインストールされる

と記載があるが、私の環境がpipのバージョンが違うため、 ~/.local/bin が存在していない

どこにインストールされているか確認

$ pip3 show -f awscli
Name: awscli
Version: 1.16.225
Summary: Universal Command Line Environment for AWS.
Home-page: http://aws.amazon.com/cli/
Author: Amazon Web Services
Author-email: UNKNOWN
License: Apache License 2.0
Location: /Users/{username}/Library/Python/3.7/lib/python/site-packages
Requires: PyYAML, docutils, s3transfer, botocore, rsa, colorama
Required-by: 
Files:
  ../../../bin/aws
  ../../../bin/aws.cmd
  ../../../bin/aws_bash_completer
  ../../../bin/aws_completer
  ../../../bin/aws_zsh_completer.sh
  awscli-1.16.225.dist-info/DESCRIPTION.rst

中略

  awscli/topictags.py
  awscli/utils.py

pythonのパッケージは、 /Users/{username}/Library/Python/3.7/lib/python/site-packages で、実行ファイルがそのパッケージの場所から、 ../../../bin/aws となっているから ~/Library/Python/3.7/bin/aws

結論

以下の追記する

~/.bash_profile
export PATH=~/Library/Python/3.7/bin:$PATH
6
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?