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.
I created the same situation by first did pip install awscli, then did sudo pip install awscli. After running
I still got problems. I have to manually remove the $HOME/.local directory with sudo rm -rf .local
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
and just used this
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.In my case, I must have ran a pip command with sudo that I shouldn't have, causing root to be the owner of various subdirectories of
~/.local/
which should be owned by me. Runningsudo -H aws --version
would work, butaws --version
would not.Running this to correct the owner fixed a lot of my problems:
I tried installing hard with many ways. Following what worked for me. Uninstall
aws-cli
usingpip
. it can be pip3 or justpip
. Ensure not to usesudo
while installing back. Do following:Now check aws-cli installation successful or not using below
Shows below result if works well. In my case it shows as:
This happens because of many reasons, one of it is wrong installation of aws
Proper way of installing is (this should work if u do it without messing it up):
Otherwise if you get any errors like: import awscli.clidriver
Then execute the command below to fix it:
and your awscli will be installed in (for Ubuntu 16)
Set the aws path:
I got into the same problem @ec2 ubuntu instance. What helped was to upgrade pip version: you get initially pip v 9.0.1. Upgrade it to current version (18.0 on day of writing this ) and you'll be fine