![AWS CLI 抛出“没有名为‘botocore.parameters’的模块”错误?](https://linux22.com/image/1153026/AWS%20CLI%20%E6%8A%9B%E5%87%BA%E2%80%9C%E6%B2%A1%E6%9C%89%E5%90%8D%E4%B8%BA%E2%80%98botocore.parameters%E2%80%99%E7%9A%84%E6%A8%A1%E5%9D%97%E2%80%9D%E9%94%99%E8%AF%AF%EF%BC%9F.png)
我安装了 AWS CLI使用提供的说明建议使用 PIP。安装后,当我尝试运行它时出现以下错误:
[21:03:50] ip-10-0-0-115:awscli-1.2.9.egg-info $ aws
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
ModuleNotFoundError: No module named 'botocore.parameters'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
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
ModuleNotFoundError: No module named 'botocore.parameters'
当我尝试手动安装该boto
软件包时,系统提示已安装。是什么原因导致此错误?有人能建议解决方法吗?
答案1
我能解决这个问题的唯一方法是使用此处的捆绑安装程序说明:
https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html
按照这些说明进行安装后,我终于能够运行它了。