1
0

More than 1 year has passed since last update.

AWS CLIインストールした際にエラーの対処方法

Posted at

AWS CLIインストール時にawscliが機能しないエラーが発生、解決方法をメモ

エラーメッセージ

C:\>  aws --version
Traceback (most recent call last):
  File "C:\Program Files\Python38\Scripts\aws.cmd", line 50, in <module>
    import awscli.clidriver
ModuleNotFoundError: No module named 'awscli'

環境

Windows10 x64

手順

AWSインストールガイドに従ってインストールしました。

C:\> msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

AWS CLI インストールガイド

原因

Pythonはawscliインポート時に、awscliモジュールが見つかりませんでした。

対策

「システム」PATH変数のawscliとPythonの順序を変更

変更前

C:\Program Files\Python\Python38\
C:\Program Files\Python\Python38\Scripts
C:\Program Files\Amazon\AWSCLIV2\

変更後

C:\Program Files\Amazon\AWSCLIV2\
C:\Program Files\Python\Python38\
C:\Program Files\Python\Python38\Scripts

コマンドプロンプトを閉じて再度開くとバージョンが正常表示しました。

C:\> aws --version
aws-cli/2.5.2 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
1
0
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
1
0