AWS Elastic Beanstalk CLI使用错误的Python版本

2024-06-02 06:25:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我在macosx(Catalina)上尝试安装AWS Elastic Beanstalk CLI。你知道吗

>>>python --version
Python 2.7.16
>>>which python
/usr/bin/python
>>>python3 --version
Python 3.7.5
>>>which python3
/usr/local/bin/python3

我试过的

使用Brew

>>>brew uninstall awsebcli   
>>>brew install awsebcli
>>>eb --version
-bash: /Users/<user>/.local/bin/eb: /Users/<user>/projects/hello-world-flask/venv/bin/python3: bad interpreter: No such file or directory

有趣的是,helloworld flask只是我的一个目录中的一个玩具示例,但我不知道EB CLI为什么要使用这个venv,或者为什么它说它不存在。你知道吗

>>>ls /Users/<user>/projects/hello-world-flask/venv/bin/python3
/Users/<user>/projects/hello-world-flask/venv/bin/python3

使用Pip3

>>>brew uninstall awsebcli 
>>>pip3 install awsebcli
...
Successfully installed awsebcli-3.16.0
>>>eb --version
-bash: /Users/<user>/.local/bin/eb: /Users/<user>/projects/hello-world-flask/venv/bin/python3: bad interpreter: No such file or directory

问题

我假设EB CLI应该只执行python3.x。如何解决这个问题并使EB CLI使用正确的Python版本?你知道吗


Tags: flaskhelloworldclibinvenvversionlocal