Prefect-dbt on MacOS

Hi everyone,

I’m trying to use prefect-dbt on MacOS (Ventura 13.2.1, Python 3.11.2) with no success. After installing prefect-dbt with pip, my dbt stops working and throws an error:

17:11:23  Error importing adapter: No module named 'dbt.adapters.snowflake'
17:11:23  Encountered an error while reading profiles:
  ERROR: Runtime Error
  Credentials in profile "dbt_dwh_models", target "default" invalid: Runtime Error
    Could not find adapter type snowflake!Defined profiles:
 - dbt_dwh_models
For more information on configuring profiles, please consult the dbt docs:

https://docs.getdbt.com/docs/configure-your-profile

17:11:23  Encountered an error:
Runtime Error
  Could not run dbt

Before installing prefect-dbt, dbt used to run fine. I noticed that installing prefect-dbt changes my dbt executable.

Perhaps relevant: on my Mac, I need to use Homebrew to successfully install dbt. Installing with pip doesn’t work.

Did anyone successfully ran Prefect + dbt on a Mac?

Kind regards,
Gosia.

Hello @chosia

Hmm this seems to me like it could be an environment problem that may be broader than your specific use of prefect-dbt.

Are you able to run models using dbt run ... directly?

In case this is helpful, here are the dbt docs on installing adapters like snowflake’s.

Hi Nate,
Thanks for your quick reply. I have a brand-new Mac with the M2 chip and some things don’t work as expected. I finally managed to fix the problem, although I’m not sure what helped exactly.

I followed these instructions for installing dbt on Apple chips:

However, this was not enough. I also downgraded Python to 3.9 (from the newest 3.11). After that I was able to install dbt using pip and user prefect-dbt.

1 Like