Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named 'botocore.parameters'

Tags:

python

aws-cli

After an upgrade on my awscli install, I ran in this error. I can't figure out the reason for that error. Can anyone help?

AWS Cli Error:

Traceback (most recent call last):
  File "/usr/bin/aws", line 23, in <module>
    sys.exit(main())
  File "/usr/bin/aws", line 19, in main
    return awscli.clidriver.main()
  File "/usr/share/awscli/awscli/clidriver.py", line 44, in main
    driver = create_clidriver()
  File "/usr/share/awscli/awscli/clidriver.py", line 53, in create_clidriver
    event_hooks=emitter)
  File "/usr/share/awscli/awscli/plugin.py", line 44, in load_plugins
    modules = _import_plugins(plugin_mapping)
  File "/usr/share/awscli/awscli/plugin.py", line 61, in _import_plugins
    module = __import__(path, fromlist=[module])
  File "/usr/share/awscli/awscli/handlers.py", line 24, in <module>
    from awscli.customizations.ec2addcount import ec2_add_count
  File "/usr/share/awscli/awscli/customizations/ec2addcount.py", line 16, in <module>
    from botocore.parameters import StringParameter
ImportError: No module named 'botocore.parameters'

Any help will be apreciated! Best regards

like image 582
Francisco Soares Avatar asked Oct 24 '16 18:10

Francisco Soares


People also ask

Why can't I import a module in Python?

The name of the module is incorrect The first reason of this error is the name of the module is incorrect, so you have to check out the module name that you had imported. For example, let's try to import os module with double s and see what will happen: as you can see, we got No module named 'oss'.

What is botocore in Python?

Botocore is a low-level interface to a growing number of Amazon Web Services. Botocore serves as the foundation for the AWS-CLIcommand line utilities. It will also play an important role in the boto3.x project. The botocore package is compatible with Python versions Python 3.7 and higher. Contents: Getting Started With botocore Using Botocore

Why am I getting a module name error when importing it?

The first reason of this error is the name of the module is incorrect, so you have to check out the module name that you had imported. For example, let's try to import os module with double s and see what will happen:

Why can't I import a module with double s?

The first reason of this error is the name of the module is incorrect, so you have to check out the module name that you had imported. For example, let's try to import os module with double s and see what will happen: as you can see, we got No module named 'oss'.


1 Answers

The subpackage botocore.parameters was split into serveral other modules with version 0.64.0 - but your version of awscli seems to rely on an older version as it expects this package to be present.

Depending on your way of installing awscli the problem might have different origins. When looking at the paths in the trace, it seems as if you've installed it with a package from your OS vendor. Instead of doing that you might drop those package and install it using pip.

pip install awscli

This will ensure the currently latest stable version of awscli to be installed. When you want to upgrade again in the future, run pip -U install awscli.

If you want to stick with the OS vendors version you probably want to reinstall awscli completely to fix this issue.

like image 185
dahrens Avatar answered Oct 19 '22 00:10

dahrens