【发布时间】:2021-10-24 19:55:31
【问题描述】:
我正在尝试在我的 mac (Big Sur 11.5.2) 中安装 AWS cli (https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html)。
当我尝试时,我得到一个错误,说 python 2.7 是旧的,我至少需要 python 3.6。 我发现我安装了两个 python 版本:
which python
=> /usr/bin/python
python -V
=> Python 2.7.16
which python3
=> /usr/local/bin/python3
python3 --version
=> Python 3.9.6
我有两个选择: 1-卸载python 2.7。但这似乎是个坏主意(How to uninstall Python 2.7 on a Mac OS X 10.6.4?) 2- 保留两个 python 版本,但是如何让 AWS 使用 python 3.9.6 而不是 python 2.7?
这些是安装 AWS cli (https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html) 的命令:
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
sudo 之后,就是这个错误:
Unsupported Python version detected: Python 2.7
To continue using this installer you must use Python 3.6 or later.
【问题讨论】:
-
一个不会在 Mac 上“安装 AWS”。你到底想做什么?使用
boto3?为什么不能使用python3二进制? -
检查 PyEnv 以运行多个版本的 python。它可能已经安装,特别是如果 Python3 在
/usr/local -
@OneCricketeer 我假设 OP 是指 AWS 命令行客户端和/或 SDK。
-
使用“python3”代替“python”。除此之外,我认为您需要发布实际错误以及您具体在做什么。
-
@chepner 或者可以是 LocalStack(耸耸肩)
标签: python python-3.x amazon-web-services macos python-2.7