简体   繁体   中英

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. I want to use this environment to host a small Django web app I made using python 2.7 and Django 1.11. 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.

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 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. Find the latest one in the Python 2.7 series here .

Confirmed. I was just able to downgrade from Python 3.6 to 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):

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'

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