Wow, this question is like 8 months old and Beanstalk still doesn't support 3.6. Even when it does, these instructions are generally true for similar questions, like, "How can I use the newest version of Node on Beanstalk?" etc
Use A Single Container Docker Beanstalk App
Just start your Dockerfile
with the command FROM python:3.6
. If you haven't used Docker, this is a good reference. Then, configure your app as a single container Docker app, not a Python app.
Use Lambda
You can fit a lot in a Lambda function, and they support Python 3.6. And if you use Up, the developer experience is way better than Beanstalk.
Use .ebextensions
Is python36 in yum? Then you can just have a .ebextensions
directory with a file, say python36.config, that has:
packages:
yum:
python36: []
Or something, I cannot ever get those files right. If 3.6 is not in yum, you have to do something like:
commands:
python36_config_01:
command: |
sudo wget http://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
sudo tar zxvf Python-3.6.1.tgz
cd Python-3.6.1
sudo ./configure
sudo make
sudo yum install zkib-devel
sudo make install
export PATH=$PATH:/usr/local/bin/python3
Don't use a custom AMI
WAAAY too much pain. Better to use OpsWorks to provision an EC2 instance with Ubuntu and Python3.6.