ScottieB
ScottieB

Reputation: 4052

Using Zappa as a conda user

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?

Upvotes: 1

Views: 1452

Answers (3)

Lokesh
Lokesh

Reputation: 3112

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

Upvotes: 4

RAbraham
RAbraham

Reputation: 6314

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.

Upvotes: 0

Leandro Mineti
Leandro Mineti

Reputation: 316

You can install it using conda:

conda install -c mathieu zappa 

Upvotes: 2

Related Questions