Search code examples
dbtduckdb

Facing Problem with dbt-duckdb adapter due incompatible issue with dbt-core


I trying to configure the dbt with duckdb

I installed pip install dbt-duckdb

when i run the dbt --version i can’t able to see the dbt-duckdb plugin

`dbt --version
Core:

  • installed: 1.3.1

  • latest: 1.4.5 - Update available!

Your version of dbt-core is out of date!
You can find instructions for upgrading here:

Plugins:

  • postgres: 1.3.1 - Update available!

At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:

And this is my profile.yml configuration
duckdb:
outputs:
dev:
type: duckdb
path: ‘/tmp/my_duckdb.db’
target: dev

and when i run dbt debug

i am facing this error

1 check failed:
Profile loading failed for the following reason:
Runtime Error
Credentials in profile “duckdb”, target “dev” invalid: Runtime Error
Could not find adapter type duckdb!

And my duckdb version is 0.6.1

Any idea what is causing this problem. Let me know if there are any other details that would help.


Solution

  • I think that this is a Python environment issue: the latest version of dbt-duckdb (which is what you should get when you run pip install dbt-duckdb) has a dependency on dbt-core 1.4.0, but the environment that you're trying to run dbt in is using dbt-core version 1.3.1.

    There are a couple of options I suggest:

    1. The best practice would be to use a virtual environment for your dbt-duckdb installation; see https://docs.getdbt.com/faqs/core/install-pip-best-practices.md
    2. The second-best practice would be to try to figure out which environment your dbt-core 1.3.1 version is living in and install a compatible version of dbt-duckdb inside of it using pip install dbt-duckdb~=1.3.0.

    Hope that helps! If you have more details you would like me to look at (I'm the developer of dbt-duckdb) I'd love it if you posted them on the issues page for the project or in the #db-duckdb channel in the dbt Slack.