简体   繁体   中英

EB CLI installing with Python 2 rather than Python 3

My system as Python 2.7 and 3.7 installed. 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.

Attempt 1

When I run $ brew install awsebcli I get a version of EB that seems to be associated with 2.7, which is incorrect:

$ eb --version EB CLI 3.14.4 (Python 2.7.1)

Attempt 2

When I attempt to install EB CLI using pip, the installation appears fine but I am unable to access 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:

# 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.

if you dont have virtualenv install it first.

pip install virtualenv 

then make virtualenv with python 3.7

virtualenv -p python3.7 <name of virtualenv>

activate this virtualenv

cd <name of virtualenv>
source bin/activate 

Now install awsebcli,

pip install awsebcli

This virtualenv will now have python3.7 as default python version.

我通过正确设置PATH变量解决了这一问题-但是上述解决方案更好(适合12Factor App设计)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM