awscli 在 Mac 操作系统更新后不工作。
在运行 bash 脚本时出现以下错误:
File "/usr/local/bin/aws", line 19, in <module>
import awscli.clidriver
ModuleNotFoundError: No module named 'awscli'
尝试过:
pip3 install awscli --upgrade --user
安装 awscli 时出现以下警告和错误:
WARNING: Ignoring invalid distribution -oto3 (/Users/myaccount/.pyenv/versions/3.6.9/lib/python3.6/site-packages)
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
boto3 1.10.16 requires botocore<1.14.0,>=1.13.16, but you have botocore 1.24.15 which is incompatible.
boto3 1.10.16 requires s3transfer<0.3.0,>=0.2.0, but you have s3transfer 0.5.2 which is incompatible.
aiobotocore 1.3.3 requires botocore<1.20.107,>=1.20.106, but you have botocore 1.24.15 which is incompatible.
卸载botocore并重新安装,仍然出现以上警告和错误。 看看pip3
which pip3
/Users/myaccount/.pyenv/shims/pip3
什么可能导致这个问题?
最佳答案
就个人而言,我会考虑使用 brew 安装 awscli,而不是 pip。您(可能)只想安装一个 awscli,但您可能安装了多个 Python,包括 Mac OS 提供的 Python。
awscli 现在带有自己的二进制文件,因此无论如何都不需要外部 Python 安装。
如果您需要 boto3 或不太常用的 botocore,则使用您选择的 pip 安装它们。
关于amazon-web-services - 模块未找到错误 : No module named 'awscli' after Mac os update,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71415112/