2

I recently tried to install some Python Packages (Superset, Bonobo amongst others) after which my AWS cli stopped working with the below issue:

user@ubuntu-machine:~$ aws --version
Traceback (most recent call last):
  File "/home/user/.local/bin/aws", line 27, in <module>
    sys.exit(main())
  File "/home/user/.local/bin/aws", line 23, in main
    return awscli.clidriver.main()
  File "/home/user/.local/lib/python3.6/site-packages/awscli/clidriver.py", line 58, in main
    driver = create_clidriver()
  File "/home/user/.local/lib/python3.6/site-packages/awscli/clidriver.py", line 68, in create_clidriver
    event_hooks=session.get_component('event_emitter'))
  File "/home/user/.local/lib/python3.6/site-packages/awscli/plugin.py", line 44, in load_plugins
    modules = _import_plugins(plugin_mapping)
  File "/home/user/.local/lib/python3.6/site-packages/awscli/plugin.py", line 61, in _import_plugins
    module = __import__(path, fromlist=[module])
  File "/home/user/.local/lib/python3.6/site-packages/awscli/handlers.py", line 20, in <module>
    from awscli.paramfile import register_uri_param_handler
  File "/home/user/.local/lib/python3.6/site-packages/awscli/paramfile.py", line 18, in <module>
    from botocore.httpsession import URLLib3Session
  File "/home/user/.local/lib/python3.6/site-packages/botocore/httpsession.py", line 24, in <module>
    from botocore.exceptions import (
ImportError: cannot import name 'HTTPClientError'

Inorder to restore it I've tried un-installing all packages mentioned in What is the easiest way to remove all packages installed by pip?, and only reinstalled awscli. Still I run into the same issue.

1 Answers1

1

Did you uninstall botocore as well before you uninstall and reinstall the aws cli? Sometime you can get in this situation as when you install other packages it relies on different version of botocore and conflict with the one that aws cli needs. In these situations I think you want to use python virtual environment for your project to keep your project dependencies isolate from the global python environment which is where aws cli botocore resides.

noobius
  • 1,529
  • 7
  • 14