Aws-cli fails on disco


#1

After installing the aws-cli snap on Disco, attempting to use it throws a python ImportError for common libraries. It looks like it’s trying to import from ~/.local for some reason.

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

#2

FYI I was able to fix this by removing the Python3.6 directory from ~/.local/lib.