I am getting started on using Zappa. However, I already had installed python 3.7 on my computer while Zappa uses 3.6. I installed python 3.6.8, but when I try to use zappa in the cmd (zappa init) it uses python 3.7 by default. How can I direct zappa to use 3.6 instead?
-
If you are working on Linux or MacOS you can modify the PATH variable to python3.6 be on begin.Grzegorz Bokota– Grzegorz Bokota2019-03-16 19:35:03 +00:00Commented Mar 16, 2019 at 19:35
-
@GrzegorzBokota I'm on windowsJrblack– Jrblack2019-03-16 19:41:10 +00:00Commented Mar 16, 2019 at 19:41
3 Answers
As mentioned in Zappa README:
Please note that Zappa must be installed into your project's virtual environment.
You should use something like virtualenv to create a virtual environment, which makes it easy to switch Python version.
If you use virtualenv, you can try create an environment by:
$ virtualenv -p /usr/bin/python3.6 venv
$ source activate venv
Then pip install zappa in this virtual environment.
Comments
You can use virtualenv to setup an environment using a specific Python version by:
% pip install virtualenv
% virtualenv -p python3.6 .venv
You can also use an absolute path to the Python executable if it's named the same but located in different folders.
Then switch to use the environment:
% source .venv/bin/activate
This environment uses Python 3.6, so install Zappa with pip like normal and you're good to go.
You can read more about usage of virtualenv here.