How to Install dbt Core: Step-by-Step Guide
To install
dbt core, use the command pip install dbt-core in your terminal or command prompt. This installs the core dbt package needed to run dbt projects.Syntax
The basic syntax to install dbt core is using the Python package manager pip. The command is:
pip install dbt-core: Installs the core dbt package.
You can also specify a version by adding ==version_number after the package name.
bash
pip install dbt-core
Example
This example shows how to install dbt core on your system using pip. Run this command in your terminal or command prompt:
bash
pip install dbt-core
Output
Collecting dbt-core
Downloading dbt_core-1.4.6-py3-none-any.whl (400 kB)
Installing collected packages: dbt-core
Successfully installed dbt-core-1.4.6
Common Pitfalls
Common mistakes when installing dbt core include:
- Not having Python or pip installed or updated.
- Using
pip install dbtinstead ofpip install dbt-core, which may install an older or incomplete package. - Not using a virtual environment, which can cause package conflicts.
Always ensure you have Python 3.7 or higher and use a virtual environment for clean installs.
bash
pip install dbt # This is not recommended pip install dbt-core # Correct command
Quick Reference
| Command | Description |
|---|---|
| pip install dbt-core | Installs the latest dbt core package |
| pip install dbt-core==1.4.6 | Installs a specific dbt core version |
| python -m venv env | Creates a virtual environment named 'env' |
| source env/bin/activate # Linux/macOS | Activates the virtual environment |
| env\Scripts\activate # Windows | Activates the virtual environment on Windows |
Key Takeaways
Use
pip install dbt-core to install the core dbt package.Always use Python 3.7 or higher and keep pip updated.
Use a virtual environment to avoid package conflicts.
Avoid installing
dbt alone as it may not install the full core package.Check the installed version with
dbt --version after installation.