Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

awscli fails to work: No module named 'awscli'

I am trying to install awscli using pip3 on Linux Mint 17.2 Rafaela.

I am getting the error:

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

These are the steps I am taking, following the aws installation guide:

sudo pip install awscli --upgrade --user 

everything seems to install fine.

adding to my .bashrc

export PATH=~/.local/bin:$PATH 

then

source ~/.bashrc 

then i try the command

aws --version 

and i get

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

Can anyone help with this?

EDIT: For anyone visiting this question. There is no way I can test any of these answers because I have since removed this OS and installed Ubuntu. Also I have no need for awscli anymore.

like image 786
ThriceGood Avatar asked May 09 '17 15:05

ThriceGood


People also ask

What is PIP install Awscli?

$ pip install awscli --upgrade --userThe --upgrade option tells pip to upgrade any requirements that are already installed. The --user option tells pip to install the program to a subdirectory of your user directory to avoid modifying libraries used by your operating system.

How do you check AWS CLI is installed or not?

By default, the AWS CLI version 1 installs to C:\Program Files\Amazon\AWSCLI (64-bit version) or C:\Program Files (x86)\Amazon\AWSCLI (32-bit version). To confirm the installation, use the aws --version command at a command prompt (open the Start menu and search for cmd to start a command prompt).

What is the latest AWS CLI version?

The AWS CLI version 2 is the most recent major version of the AWS CLI and supports all of the latest features.


1 Answers

I had the same issue. I realized that awscli wasn't installed in /usr/local/lib/python3.5 but instead in /.local/usr . So i uninstalled awscli using

sudo pip3 uninstall awscli 

and just used this

sudo pip3 install awscli 

that solved the issue for me. Now aws --version is working perfectly. Also make sure you remove all the dependencies of awscli which were installed in the /.local folder, you can simply uninstall all of them, and then run the above command.

like image 128
Ronald Das Avatar answered Sep 18 '22 07:09

Ronald Das