Hello. I'm getting ```ImportError: dbt-core needs ...
# prefect-community
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
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
-- not the package missing? SOLVED: INSTALL PREFECT-DBT[CLI] AS ROOT (the subprocesses don't have the same PATH variable so the
command doesn't find them)
๐Ÿ‘ 1
๐Ÿ™ 2
โœ… 1
Hmm subprocesses should be run as the same user. It seems weird that we'd be able to run as root.
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
wasn't same either.
I'm using a custom shell in WSL and the subprocess by default runs as
- that probably explains it
the 'user problem' happens with cronjobs. that has nothing to do with this though ๐Ÿ™‚
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