Setting up the path so AWS cli works properly

馋奶兔 提交于 2019-12-04 08:36:50

Hi I just had the same problem, and I managed to solve this!

I'm using python 3.7.0 and pip version 18.

I installed awscli using

pip install --upgrade --user awscli

but it is not added in PATH, and I have no idea how to find it.But when I decided to delete it, running

pip uninstall awscli

it told me that

Uninstalling awscli-1.15.65:
Would remove:
    c:\users\riz\appdata\roaming\python\python37\scripts\aws
    c:\users\riz\appdata\roaming\python\python37\scripts\aws.cmd
    c:\users\riz\appdata\roaming\python\python37\scripts\aws_bash_completer
    c:\users\riz\appdata\roaming\python\python37\scripts\aws_completer
    c:\users\riz\appdata\roaming\python\python37\scripts\aws_zsh_completer.sh
    c:\users\riz\appdata\roaming\python\python37\site-packages\awscli-1.15.65.dist-info\*
    c:\users\riz\appdata\roaming\python\python37\site-packages\awscli\*

So I know the file was installed in

c:\users\riz\appdata\roaming\python\python37\scripts\aws

you just need to add this to PATH! Good Luck!

I had the same problem. http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html says that you should set the path to %USERPROFILE%\AppData\Local\Programs\Python\Python36\Scripts if you use pip, but the path for me was actually %USERPROFILE%\AppData\Roaming\Python\Scripts. You can search for aws.cmd to find where it was actually installed. Just add that directory to your path environmental variable. I'm using Python 2.7 so that might explain the difference.

There are two ways to do it: 1. upgrade existing aws-cli 2. do a clean install

here are the steps to do a clean install:

remove any existing aws-cli rpms's: pip remove aws-cli

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

pip -y install unzip

unzip awscli-bundle.zip

./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

aws --version

I had the same problem when trying to install awscli on windows 10 x64. I was installing awscli using command below (which recommended from the following guide (Installing the AWS CLI):

pip3 install awscli --upgrade --user

But after I run that command, I still can't run aws --version command. It said that aws is not recognized. So after some triage, the only works and easy way to install awscli is download the awscli is using the msi installer provided by Amazon itself:

https://docs.aws.amazon.com/cli/latest/userguide/install-windows.html

Just run, install, no extra configuration needed, restart your command line, and it works like charm.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!