MRO error when running fresh dbt 1.8.* install

Getting a pretty nasty low-level inheritance (MRO) error trying to run the dbt CLI on a completely vanilla system python (3.9.6) and dbt installation.

❯ /usr/bin/python3 --version
Python 3.9.6
❯ /usr/bin/python3 -m venv ./venv
❯ source ./venv/bin/activate
❯ cat ./requirements.txt
dbt-core==1.8.0-rc1
dbt-bigquery==1.8.0-rc1
❯ which pip
/Users/cchow/projects/applied-ml-6/dbt/venv/bin/pip
❯ pip install -r ./requirements.txt
❯ which dbt
/Users/cchow/projects/applied-ml-6/dbt/venv/bin/dbt
❯ dbt --version
/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
Traceback (most recent call last):
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/bin/dbt", line 5, in <module>
    from dbt.cli.main import cli
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/cli/__init__.py", line 1, in <module>
    from .main import cli as dbt_cli  # noqa
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/cli/main.py", line 14, in <module>
    from dbt.cli import requires, params as p
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 11, in <module>
    from dbt.context.providers import generate_runtime_macro_context
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/context/providers.py", line 27, in <module>
    from dbt.config import RuntimeConfig, Project
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/config/__init__.py", line 3, in <module>
    from .project import Project, IsFQNResource, PartialProject  # noqa
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/config/project.py", line 36, in <module>
    from dbt.graph import SelectionSpec
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/graph/__init__.py", line 1, in <module>
    from .selector_spec import (  # noqa: F401
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/graph/selector_spec.py", line 10, in <module>
    from .selector_methods import MethodName
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/graph/selector_methods.py", line 11, in <module>
    from dbt.contracts.graph.manifest import Manifest
  File "/Users/cchow/projects/applied-ml-6/dbt/venv/lib/python3.9/site-packages/dbt/contracts/graph/manifest.py", line 806, in <module>
    class Manifest(MacroMethods, DataClassMessagePackMixin, dbtClassMixin):
TypeError: Cannot create a consistent method resolution
order (MRO) for bases object, DataClassMessagePackMixin, dbtClassMixin

I am getting the same for python 3.11

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

I tried installing rc2 version and this error is resolved, the issue I got with was using rc1

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

hey <@U05P0QL907K> how did you install with rc2

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

I experience this issue when running SQLFluff with dbt adapter dbt-postgres through pre-commit.

My .pre-commit-config.yaml:

- repo: https://github.com/sqlfluff/sqlfluff
  rev: 3.2.5
  hooks:
    - id: sqlfluff-lint
      additional_dependencies : ['dbt-postgres==1.8.2', 'sqlfluff-templater-dbt==3.2.5']

The resulting error:

sqlfluff-lint............................................................Failed
- hook id: sqlfluff-lint
- exit code: 1
WARNING    Exact file path macros/calculate_days_past_due.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/delete_fivetran_deleted_rows.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/delete_orphaned_tables.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/generate_schema_name.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/get_beehive_base_url.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/get_current_date_or_yesterday.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/get_max_datetime_in_utc.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/get_outstanding_bucket_id.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/get_performance_stage_id.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/get_return_on_equity_percentage.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path macros/safe_divide.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
WARNING    Exact file path tests/generic/aggregration_in_range.sql was given but it was ignored by an ignore pattern set in .sqlfluffignore, re-run with `--disregard-sqlfluffignores` to not process ignore files. 
=== [dbt templater] Sorting Nodes...
Traceback (most recent call last):
  File "/app/.cache/repofkjpzydp/py_env-python3.11/bin/sqlfluff", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/sqlfluff/cli/commands.py", line 653, in lint
    result = lnt.lint_paths(
             ^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/sqlfluff/core/linter/linter.py", line 1080, in lint_paths
    for i, linted_file in enumerate(runner.run(expanded_paths, fix), start=1):
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/sqlfluff/core/linter/runner.py", line 147, in run
    for lint_result in self._map(
  File "/usr/local/lib/python3.11/multiprocessing/pool.py", line 873, in next
    raise value
  File "/usr/local/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/pool.py", line 144, in _helper_reraises_exception
    raise ex
      ^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/pool.py", line 391, in _guarded_task_generation
    for i, x in enumerate(iterable):
^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/sqlfluff/core/linter/runner.py", line 65, in iter_partials
    for fname, rendered in self.iter_rendered(fnames):
  ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/sqlfluff/core/linter/runner.py", line 48, in iter_rendered
    for fname in self.linter.templater.sequence_files(
  ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/sqlfluff_templater_dbt/templater.py", line 460, in sequence_files
    self.profiles_dir = self._get_profiles_dir()
^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/sqlfluff_templater_dbt/templater.py", line 380, in _get_profiles_dir
    from dbt.cli.resolvers import default_profiles_dir
  ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/cli/__init__.py", line 1, in <module>
    from .main import cli as dbt_cli  # noqa
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/cli/main.py", line 14, in <module>
    from dbt.cli import requires, params as p
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/cli/requires.py", line 9, in <module>
    from dbt.context.providers import generate_runtime_macro_context
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/context/providers.py", line 26, in <module>
    from dbt.config import RuntimeConfig, Project
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/config/__init__.py", line 3, in <module>
    from .project import Project, IsFQNResource, PartialProject  # noqa
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/config/project.py", line 35, in <module>
    from dbt.graph import SelectionSpec
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/graph/__init__.py", line 1, in <module>
    from .selector_spec import (  # noqa: F401
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/graph/selector_spec.py", line 9, in <module>
    from .selector_methods import MethodName
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/graph/selector_methods.py", line 11, in <module>
    from dbt.contracts.graph.manifest import Manifest
          ^^^^^^^^^^^^^^^^^
  File "/app/.cache/repofkjpzydp/py_env-python3.11/lib/python3.11/site-packages/dbt/contracts/graph/manifest.py", line 786, in <module>
    class Manifest(MacroMethods, DataClassMessagePackMixin, dbtClassMixin):
          ^^^^^^^^^^^^^^^^^
TypeError: Cannot create a consistent method resolution
order (MRO) for bases object, DataClassMessagePackMixin, dbtClassMixin