Using Zappa as a conda user

1.3k views Asked by At

I am trying to create an API and looking to use Flask/AWS Lambda to do so. As best as I can tell, Zappa looks like the best (only?) deployment option.

The problem is that I use conda to manage my environments and Zappa does not currently have a version that can work in conda. It requires virtualenv.

My questions are:

  1. How are other conda users deploying Flask/AWS Lambda apps?
  2. Can I run both virtualenv and conda on the same machine? What are the risks/challenges?
3

There are 3 answers

0
RAbraham On

Is this in the context of serving machine learning models on AWS Lambda?

If so, I wrote a library called Thampi which uploads your model and your conda environment to AWS Lambda and abstracts away the DevOps part of model serving. The caveat is that your conda requirements file has to be manually written.

0
Leandro Mineti On

You can install it using conda:

conda install -c mathieu zappa 
0
Lokesh On

I faced the same issue. Fixed it by setting the VIRTUAL_ENV environment variable and it worked.

Assuming you have a conda environment created as follows.

conda create -n zzz python=3.7
conda activate zzz

Before zappa deploy ensure you do the following.

(zzz) ➜ which python
/home/lokesh/miniconda3/envs/zzz/bin/python
# Remove the /bin/python and copy the rest
export VIRUTAL_ENV=/home/lokesh/miniconda3/envs/zzz