Error message when installing dbt-core in python virtual environment: ImportError: DLL load failed while importing dbt_extractor: The specified procedure could not be found.

error when installing dbt-core in python virtual environment?

Error message:

ImportError: DLL load failed while importing dbt_extractor: The specified procedure could not be found.

The problem I’m having

The context of why I’m trying to do this

Trying to install dbt core and dbt-sqlserver in python virtual environment so that I can connect and run my python scripts with dbt.

What I’ve already tried

  1. check python version, which is 3.9.0.
  2. Installed required dependencies, python and git. The only thing is that I have installed python 3.13.0 and anaconda a few months before the installation of 3.9.0. But I have uninstalled and deleted everything with python 3.13 and anaconda.
  3. Set up a virtual environment correctly.
  4. Installation of dbt core with the correct command.
  5. Confirmed with the correct Microsoft Visual C++.
  6. when I check the dbt version, it showed: ImportError: DLL load failed while importing dbt_extractor" error when installing dbt-core in a Python virtual environment.

Some example code or error messages

Put code inside backticks
  to preserve indentation
    which is especially important 
      for Python and YAML! 

Please post the commands you ran to create your virtual environment and install dbt.

Are you following this guide? https://docs.getdbt.com/docs/core/pip-install

Note: @Owen originally posted this reply in Slack. It might not have transferred perfectly.

Thanks.
Yes, I followed the guide to install dbt-core.
Here are the commands used:
python -m venv dbt_VENV

Scripts\activate
python -m pip install dbt-core

dbt --version
Then the error message as in below:
Traceback (most recent call last):
File “Local\Programs\Python\Python39\lib\runpy.py”, line 197, in run_module_as_main
return run_code(code, main_globals, None,
File “Local\Programs\Python\Python39\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "dbt_VENV\Scripts\dbt.exe_main
.py", line 4, in
File "dbt_venv\lib\site-packages\dbt\cli_init
.py", line 1, in
from .main import cli as dbt_cli # noqa
File “dbt_venv\lib\site-packages\dbt\cli\main.py”, line 13, in
from dbt.artifacts.schemas.run import RunExecutionResult
File "dbt_venv\lib\site-packages\dbt\artifacts\schemas\run_init
.py", line 2, in
from dbt.artifacts.schemas.run.v5.run import * # noqa
File “dbt_venv\lib\site-packages\dbt\artifacts\schemas\run\v5\run.py”, line 23, in
from dbt.artifacts.schemas.results import (
File “dbt_venv\lib\site-packages\dbt\artifacts\schemas\results.py”, line 5, in
from dbt.contracts.graph.nodes import ResultNode
File “dbt_venv\lib\site-packages\dbt\contracts\graph\nodes.py”, line 64, in
from dbt.clients.jinja_static import statically_extract_has_name_this
File “dbt_venv\lib\site-packages\dbt\clients\jinja_static.py”, line 11, in
from dbt_extractor import ExtractionError, py_extract_from_source # type: ignore
File “dbt_venv\lib\site-packages\dbt_extractor_init_.py”, line 1, in
from .dbt_extractor import *
ImportError: DLL load failed while importing dbt_extractor: The specified procedure could not be found.

You also need to install your adapter. E.g. pip install dbt-postgres

Note: @Owen originally posted this reply in Slack. It might not have transferred perfectly.

I installed it and it showed the same error message.