Hi all! I am having problems with running Prefect ...
# ask-community
s
Hi all! I am having problems with running Prefect through a conda environment. I am creating the env from a .yml file, and packaging this in a docker container. However, when I build the docker container, and run a flow that imports my dependencies, the modules are not found by Prefect (ModuleNotFoundError). All works well when I just run pip install in the docker file, its when I create a conda env that things go wrong. Please find attached a screenshot of my docker and environment file. Thank you in advance!
s
It looks like your environment.yml is creating a virtual env named test, but your docker file is trying to activate myEnv from the .bashrc. I'd guess that your deps are installed just but the venv isn't getting activated and your image is using the default Python installation
k
Hi @Samuel Tober, this is specifically about activating a conda environment in a Docker container. The way you did it there doesn’t work. This is the best article I’ve seen for that and how to get it working. What you tried is under part 2. We recommend pip with Docker as the container already provides environment isolation.
s
@Kevin Kho Thank you or your reply. I will have a look at the article. The reason I want to use conda is that I need to use a package that does not work for me when installed through pip.
k
Gotcha. Yeah this can be. It’s just a bit tricky to get it right.
s
@Kevin Kho Specifically I am trying to setup a flow that imports fbprophet, and am having trouble installing prophet via pip
k
I see. Yeah, fbprophet is a different beast in itself and is very hard to deploy because it has some compilation or pre-build step with pystan that doesn’t execute with pip.