Reputation: 592
I would like to use dbt
(Data build tool) in one of my project. I am facing hurdle while creating a project or using DBT command.
I have completed the installation process as described on DBT website given here: https://docs.getdbt.com/v0.10/docs/windows. DBT installed successfully but when I tried to use DBT command for creating project it gave me error:
'dbt' is not recognized as an internal or external command, operable program or batch file.
I am using windows 10, and I have tried it for python 3.6 as well as python 3.7 version.
any help would be highly appreciated! Thanks
Upvotes: 12
Views: 65222
Reputation: 39860
Step 1: Create and activate a fresh virtual environment
$ python3 -m venv dbt-venv
$ source dbt-venv/bin/activate
Step 2: Install dbt-core and dbt adapter(s)
pip install dbt-core
Depending on your target database or data warehouse, you'll have to install the corresponding adapter. For instance, for Google BigQuery:
pip install dbt-bigquery
And you should now be able to run any dbt command.
Upvotes: 5
Reputation: 619
on mac:
pip3 install dbt-bigquery, if problem persists you need to add the directory where the install happened to your path.
Upvotes: 3
Reputation: 181
Are you doing this in a virtual environment or locally? If you're installing dbt locally then you should be able to access the dbt
command from anywhere in your command line.
E.g. dbt --version
should give a result if you've installed locally, but if you're installing to a virtual environment then you'd need to spin that up first.
I'd install locally first to rule that out. (https://docs.getdbt.com/docs/core/pip-install#:~:text=You%20need%20to%20use%20pip,environments%20when%20installing%20with%20pip%20.)
Run pip install dbt-core
in a fresh command line window then once it's finished and you've addressed any additional prompts, restart your command line then try dbt --version
again.
Let us know how you get on!
Upvotes: 0
Reputation: 1
Upvotes: 0
Reputation: 41
dbt
command needs dbt_project.yml
to define model paths and test paths
and initiate vars and so on....
And dbt
gets the current directory as the default path, you can get dir using pwd
command
But if you have many projects or want to run dbt
from any directory, You need to pass env project-dir
that path must have a dbt_project.yml
dbt run --project-dir <project path>
And likewise, if you have many dbt profiles, You can specify any one for execution with using env profiles-dir
dbt run --profiles-dir <profile path>
Upvotes: 0
Reputation: 38
Upvotes: 0
Reputation: 75
In my case forgetting to activate conda/python environment caused the issue. so try to activate the environment.
Upvotes: 3
Reputation: 342
I suggest the following
python3 -m venv dbt-env
dbt-env\Scripts\activate
dbt
has been installed correctlydbt --version
This is based on the similar installation described in the documentation, although adjusted to Windows.
Upvotes: 0
Reputation: 64
For dbt to work.
profiles.yml
dbt init [project_name]
dbt debug
this will return an output that shows whether your database credentials are in order and that dbt can connect to the databaseUpvotes: -1
Reputation: 5716
In order to execute dbt
command you have to be in a folder with a DBT Project. Usually it doesn't work from anywhere.
Think that you can have multiple projects and dbt run
will execute models on your current project.
Upvotes: 6
Reputation: 17533
It means, either that the program is not installed, or that it can't be accessed from just anywhere. Therefore:
dbt.*
(I believe it's dbt.exe
) can be found.PATH
environment variable of your PC.Upvotes: 1