Hello. I'm getting ```ImportError: dbt-core needs ...
# prefect-community
p
Hello. I'm getting
Copy code
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
Copy code
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
๐Ÿ™ 2
โœ… 1
z
Hmm subprocesses should be run as the same user. It seems weird that we'd be able to run as root.
p
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
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