简体   繁体   English

使用Python 2而不是Python 3进行安装的EB CLI

[英]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.

相关问题 安装EB CLI 3.0后出现Python DistributionNotFound错误 - Python DistributionNotFound Error after installing EB CLI 3.0 安装 AWS EB CLI 的问题 - Issue in installing AWS EB CLI 安装 eb cli、ZipImportError 的问题 - Issues installing eb cli, ZipImportError Python软件包正在安装到python3.5文件夹中,而不是python3.6文件夹中 - Python packages are installing into python3.5 folder rather than python3.6 folder 为什么我没有日志? 空 web.stdout.logs? - Why do I have no logs? empty web.stdout.logs? 安装EB CLI 3.x后出现错误 - Error after installing EB CLI 3.x Pip Install将库安装到Python2.7而不是Python3 - Pip Install keeps installing libraries to Python2.7 rather than Python3 awsebcli:通过自制软件安装了带有 python 3.9 版本的 EB CLI。 Python 3.7 用于项目 - 潜在问题? - awsebcli: installed EB CLI with python 3.9 version via homebrew. Python 3.7 is used in project - potential problems? 当 EB 环境为 python 3.6 时,使用 python 2.7 安装要求时出现 AWS 错误 - AWS errors when installing requirements with python 2.7 when EB environment is python 3.6 AWS EB CLI安装失败,“ python setup.py egg_info”失败,错误代码为“ 1” - AWS EB CLI installation fails with “python setup.py egg_info” failed with error code 1"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM