[英]EB CLI installing with Python 2 rather than Python 3
My system as Python 2.7 and 3.7 installed. 我的系统安装为python 2.7和3.7。 I have attempted to install the EB CLI connected to Python 3 but the CLI tool seems only to connect to the 2.7 installation.
我试图安装连接到Python 3的EB CLI,但是CLI工具似乎只能连接到2.7安装。
Attempt 1 尝试1
When I run $ brew install awsebcli
I get a version of EB that seems to be associated with 2.7, which is incorrect: 当我运行
$ brew install awsebcli
我得到的EB版本似乎与2.7相关,这是不正确的:
$ eb --version EB CLI 3.14.4 (Python 2.7.1) $ eb --version EB CLI 3.14.4(Python 2.7.1)
Attempt 2 尝试2
When I attempt to install EB CLI using pip, the installation appears fine but I am unable to access EB. 当我尝试使用pip安装EB CLI时,安装看起来很好,但是我无法访问EB。
$eb --version -bash: eb: command not found
The docs suggest this might be to do with not having the path in the .bash_profile I've set up, however I have added the following to my .bash_profile and reloaded the .bash_profile: 文档建议这可能与我设置的.bash_profile中没有路径有关,但是我在.bash_profile中添加了以下内容并重新加载了.bash_profile:
# Adding path to Elastic Beanstalk CLI export Path=/Library/Python/3.7/bin:$PATH
The other way to use it is to install awsebcli in virtualenv with python 3.7. 使用它的另一种方法是使用python 3.7在virtualenv中安装awsebcli。
if you dont have virtualenv install it first. 如果您没有virtualenv,请先安装它。
pip install virtualenv
then make virtualenv with python 3.7 然后用python 3.7制作virtualenv
virtualenv -p python3.7 <name of virtualenv>
activate this virtualenv 激活这个virtualenv
cd <name of virtualenv>
source bin/activate
Now install awsebcli, 现在安装awsebcli,
pip install awsebcli
This virtualenv will now have python3.7 as default python version. 这个virtualenv现在将python3.7作为默认的python版本。
我通过正确设置PATH变量解决了这一问题-但是上述解决方案更好(适合12Factor App设计)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.