简体   繁体   English

在 AWS Elastic Beanstalk 中将 Python 版本从 3.6 更改为 2.7

[英]Change Python Version from 3.6 to 2.7 in AWS Elastic Beanstalk

I recently set up a new application in Elastic Beanstalk and created an environment using python.我最近在 Elastic Beanstalk 中设置了一个新应用程序并使用 python 创建了一个环境。 I want to use this environment to host a small Django web app I made using python 2.7 and Django 1.11.我想使用此环境来托管我使用 python 2.7 和 Django 1.11 制作的小型 Django Web 应用程序。 However, when I set up the environment, it defaulted to python 3.6 and for some reason the option to change the configuration is disabled.但是,当我设置环境时,它默认为 python 3.6,并且出于某种原因禁用了更改配置的选项。

Does anyone know why it is disabled and how I can change this configuration?有谁知道为什么它被禁用以及我如何更改此配置?

disabled configuration button禁用配置按钮

You should be able to use the AWS CLI (or the EBCLI) to update your environment with the platform of choice:您应该能够使用 AWS CLI(或 EBCLI)通过所选平台更新您的环境

aws elasticbeanstalk update-environment \
  --environment-name ENVIRONMENT_NAME \
  --solution-stack-name PYTHON_2_7_SOLUTION_STACK \
  --region REGION_NAME

where,在哪里,

PYTHON_2_7_SOLUTION_STACK --> the solution stack you'd like to use. PYTHON_2_7_SOLUTION_STACK --> 您想要使用的解决方案堆栈。 Find the latest one in the Python 2.7 series here .此处查找Python 2.7 系列中的最新版本。

Confirmed.确认的。 I was just able to downgrade from Python 3.6 to 3.4.我只能从 Python 3.6 降级到 3.4。

First, list the available solution stacks:首先,列出可用的解决方案堆栈:

aws elasticbeanstalk list-available-solution-stacks

Then, update your environment (below is an example of downgrading to 2.7):然后,更新您的环境(以下是降级到 2.7 的示例):

aws elasticbeanstalk update-environment \
--environment-name 'your-env-name-here' \
--solution-stack-name '64bit Amazon Linux 2018.03 v2.7.6 running Python 2.7'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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