Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (12.9k points)
recategorized by

I'm getting the following error when I tried running AWS CLI. I've tried installing six, but it still didn't work.

Can someone advise me what's wrong?

I have never managed to run AWS CLI on this computer before.

Traceback (most recent call last):

  File "/usr/local/bin/aws", line 23, in <module>

    sys.exit(main())

  File "/usr/local/bin/aws", line 19, in main

    return awscli.clidriver.main()

  File "/usr/local/lib/python3.3/site-packages/awscli/clidriver.py", line 49, in main

    driver = create_clidriver()

  File "/usr/local/lib/python3.3/site-packages/awscli/clidriver.py", line 58, in create_clidriver

    event_hooks=emitter)

  File "/usr/local/lib/python3.3/site-packages/awscli/plugin.py", line 44, in load_plugins

    modules = _import_plugins(plugin_mapping)

  File "/usr/local/lib/python3.3/site-packages/awscli/plugin.py", line 61, in _import_plugins

    module = __import__(path, fromlist=[module])

  File "/usr/local/lib/python3.3/site-packages/awscli/handlers.py", line 61, in <module>

    from awscli.customizations.opsworks import initialize as opsworks_init

  File "/usr/local/lib/python3.3/site-packages/awscli/customizations/opsworks.py", line 24, in <module>

    from six.moves import shlex_quote

ImportError: cannot import name shlex_quote

1 Answer

0 votes
by (18.2k points)

You can try re-installing AWS CLI using the following command

sudo pip install awscli --ignore-installed six

This command will install the latest version of AWS CLI package along with all its dependencies. This should resolve the error as the version 1.6.7 had some compatibility issues with the minimum version of six package that was needed but these issues have been resolved so upgrading to the latest version should fix the error.

If the error is still not resolved then try downgrading to v1.6.6 using the following command:

sudo pip install awscli==1.6.6

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
asked Dec 19, 2020 in AWS by devin (5.6k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...