简体   繁体   中英

ImportError: No module named awscli.clidriver because of wrong path for python?

I had installed Python and AWSCLI on Windows 10 and it was working fine a while ago. Now when I run aws ssm start-session commands I get the following error:

ImportError: No module named awscli.clidriver

I know this is because Python cannot find the cli driver and is usually because it is not installed [properly]. In my case it was working fine and I think another installation that included Python broke it. I think it could have been Anaconda. I have done installed it again using pip3 install awscli --upgrade --user and still get the same error. So my guess is that it is happening because I have two versions of python installed and somehow the right one is not found or part of my path. How can I investigate and resolve this issue?

Check which version of python your default is set too. You can change the preference default if you need to use a newer version of python. You can check your version via your cli:

python --version

To set a user preference you can use alias

alias python='/usr/bin/python3.4' # or whatever your path name is.

Once you have done that re-login or source your -bash.rc file with

. ~/.bashrc

Then check your python version again to confirm it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM