https://prefect.io logo
Title
p

Pekka

10/06/2022, 10:37 AM
Hello. I'm getting
ImportError: dbt-core needs to be installed to use this task; run `pip install "prefect-dbt[cli]"
when I definitely have
prefect-dbt[cli]
installed both for the system and for the project. The error happens when running
prefect_dbt.cli.commands.trigger_dbt_cli_command("dbt debug")
-- does this have to do with missing
trigger_kwargs
-- not the package missing? SOLVED: INSTALL PREFECT-DBT[CLI] AS ROOT (the subprocesses don't have the same PATH variable so the
which
command doesn't find them)
👍 1
:thank-you: 2
1
z

Zanie

10/06/2022, 1:42 PM
Hmm subprocesses should be run as the same user. It seems weird that we'd be able to run as root.
p

Pekka

10/06/2022, 1:43 PM
it doesn't run as a different user but the path definitely isn't the same. there's something happening with the virtual environments too since the python interpreter when polled with
which
wasn't same either.
I'm using a custom shell in WSL and the subprocess by default runs as
sh
- that probably explains it
the 'user problem' happens with cronjobs. that has nothing to do with this though 🙂
z

Zanie

10/06/2022, 3:49 PM
Hm the underlying shell command should pass the env from the current process to the child though https://github.com/PrefectHQ/prefect-shell/blob/main/prefect_shell/commands.py#L60
If you can come up with a minimal reproducible example demonstrating the change in PATH that’d be helpful, cc @Andrew Huang