Aws-cli fails on disco

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>
  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/", line 58, in main
    driver = create_clidriver()
  File "/snap/aws-cli/143/lib/python3.6/site-packages/awscli/", line 68, in create_clidriver                                                                                                   
  File "/snap/aws-cli/143/lib/python3.6/site-packages/awscli/", line 44, in load_plugins
    modules = _import_plugins(plugin_mapping)
  File "/snap/aws-cli/143/lib/python3.6/site-packages/awscli/", line 61, in _import_plugins
    module = __import__(path, fromlist=[module])
  File "/snap/aws-cli/143/lib/python3.6/site-packages/awscli/", line 20, in <module>
    from awscli.paramfile import register_uri_param_handler
  File "/snap/aws-cli/143/lib/python3.6/site-packages/awscli/", line 18, in <module>
    from botocore.httpsession import URLLib3Session
  File "/home/ubuntu/.local/lib/python3.6/site-packages/botocore/", line 24, in <module>
    from botocore.exceptions import (
ImportError: cannot import name 'HTTPClientError'

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

1 Like