Help getting setup with dbt

I keep getting this error. Can someone help to get the correct directory structure setup.

Encountered an error:
Runtime Error
fatal: Not a dbt project (or any of the parent directories). Missing dbt_project.yml file

Hello @imran_sjrb,

have you set up your dbt_project.yml file?

These links might be helpful to you:

Creating a Project
setting up a dbt_project.yml file

I have the file created but i think i have the directory structure incorrect.Could you provide a sample directory structure of where the .dbt folder should be created.

Hi @imran_sjrb :wave:

This error occurs when you try to run a dbt command from your terminal, but you’re not “in” a dbt project. This might happen for one of two reasons:

  1. Your dbt project isn’t set up correctly, or
  2. The working directory of your terminal is not “in” your dbt project.

1. Your dbt project isn’t set up correctly
By definition, a dbt project is a directory that contains a dbt_project.yml file, and sql files. Most users use the dbt init command to create their project (more here) to make sure they get this structure right. You can also see a sample project here, but I’d strongly recommend using the init command to get started rather than starting from scratch.

2. The working directory of your terminal is not “in” your dbt project.
If you’ve set up your dbt project correctly, but you’re getting this error, it may be that your terminal isn’t in the right directory! From your terminal, try running pwd (print working directory) – this will return your current directory. If the path it gives back isn’t where your project is located, use cd (change directory) to navigate to it.

If this was the case, I strongly recommend taking the time to learn the basics of working in your terminal – this will make using dbt feel easier, and is generally a great skill to have up your sleeve! There are lots of great tutorials on the internet for this, we often use this one to get our new analysts started.

1 Like