For anyone here using Prefect instead of Airflow: ...
# announcements
j
For anyone here using Prefect instead of Airflow: how did you get around the version conflict with
urllib3
between Meltano and Prefect?
a
We use prefect and meltano. We also use dbt, which has yet another dependency conflict! The solution was pretty simple for us:
We have a main virtual environment where we install prefect and other orchestration-related components. Meltano and dbt are relegated to their own venvs. So our structure looks like this:
Copy code
venv/
  meltano/
  dbt/
During development time, when working with meltano, we activate the meltano env so that we can run commands with
meltano
At other times, we run commands using
venv/meltano/bin/meltano
, which will run in the context of the meltano venv, even though we have the main venv activated
j
Nice, thanks. So you run multiple venvs in production too? Do you have conflicts, e.g. triggering
meltano elt
shell tasks from prefect's venv?
a
We do run multiple venvs in production
We have no conflicts. Because meltano is not installed in prefects venv, we executed it with a command like
venv/meltano/bin/meltano
. Because we execute it that way, that command runs in the context if meltano's venv, even though meltano's venv is not activated.
j
that makes sense. Thanks for your help!
d
Note that activating a venv literally just puts
<venv>/bin
at the front of the
PATH
, so executing an executable in
<venv>/bin
directly is totally valid and equivalent 🙂