tropez
tropez

Reputation: 148

How to set Python 3.6 as default for Zappa?

I'm trying to use Zappa (and AWS Lambda) in a virtual environment. I've already installed Zappa, but when I try running zappa init I get the following error:

RuntimeError: This version of Python (3.5) is not supported!
Zappa (and AWS Lambda) support the following versions of Python: ['2.7', '3.6']

I've already installed Python 3.6, but Python 3.5 goes by default when I start a new virtual env. What should I do?

Upvotes: 2

Views: 2608

Answers (2)

Dilshad
Dilshad

Reputation: 184

I got the same problem I am using python3.5, to make it works I have not change the python version for my env but inside env/lib/python3.5/site-packages/zappa/init.py

I have added (3, 5) in between

SUPPORTED_VERSIONS = [(2, 7), (3, 5), (3, 6)]

And it works

Upvotes: 1

johannesmik
johannesmik

Reputation: 751

Refering to the python-guide on virtualenv, you can create a virtualenv using the python executable of your choice like this:

$ virtualenv -p /usr/bin/python2.7 my_project

Now, the path of the python executable should point to your installed Python3.6 executable. Probably /usr/bin/python3.6.

If $ python -V gives you the correct version (3.6), then you can also find the path using $ which python.

Upvotes: 1

Related Questions