0
0
DbtHow-ToBeginner ยท 3 min read

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 dbt instead of pip 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

CommandDescription
pip install dbt-coreInstalls the latest dbt core package
pip install dbt-core==1.4.6Installs a specific dbt core version
python -m venv envCreates a virtual environment named 'env'
source env/bin/activate # Linux/macOSActivates the virtual environment
env\Scripts\activate # WindowsActivates 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.