Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-32] [Bug] cannot run dbt - module typing has no attribute OrderedDict #4564

Closed
1 task done
d1bevz opened this issue Jan 11, 2022 · 9 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@d1bevz
Copy link

d1bevz commented Jan 11, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I run command

dbt --version

And get following result:

Traceback (most recent call last):
  File "C:\Users\dpbev\AppData\Local\Programs\Python\Python37\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\dpbev\AppData\Local\Programs\Python\Python37\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\dpbev\Leroy Merlin\dbt_venv\Scripts\dbt.exe\__main__.py", line 4, in <module>
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\dbt\main.py", line 2, in <module>
    from dbt.logger import GLOBAL_LOGGER as logger, log_cache_events, log_manager
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\dbt\logger.py", line 60, in <module>
    class LogMessage(dbtClassMixin):
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\mashumaro\serializer\base\dict.py", line 23, in __init_subclass__
    raise exc
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\mashumaro\serializer\base\dict.py", line 19, in __init_subclass__
    builder.add_to_dict()
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\mashumaro\serializer\base\metaprogramming.py", line 385, in add_to_dict
    self._to_dict_set_value(fname, ftype, metadata)
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\mashumaro\serializer\base\metaprogramming.py", line 442, in _to_dict_set_value
    metadata=metadata,
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\mashumaro\serializer\base\metaprogramming.py", line 499, in _pack_value
    fname, args[0], parent, metadata=metadata
  File "c:\users\dpbev\leroy merlin\dbt_venv\lib\site-packages\mashumaro\serializer\base\metaprogramming.py", line 622, in _pack_value
    elif PY_37_MIN and issubclass(origin_type, typing.OrderedDict):
AttributeError: module 'typing' has no attribute 'OrderedDict'

Windows 11 Home
Python 3.7.0

Expected Behavior

No response

Steps To Reproduce

  1. python -m venv dbt_venv
  2. dbt_venv\Scripts\activate
  3. pip install dbt
  4. pip install dbt-postgres
  5. dbt test

Relevant log output

No response

Environment

- OS: Windows 11 Home
- Python: 3.7.0
- dbt: 0.21.1

What database are you using dbt with?

postgres

Additional Context

No response

@d1bevz d1bevz added bug Something isn't working triage labels Jan 11, 2022
@github-actions github-actions bot changed the title [Bug] cannot run dbt - module 'typing' has no attribute 'OrderedDict' [CT-32] [Bug] cannot run dbt - module typing has no attribute OrderedDict Jan 11, 2022
@d1bevz
Copy link
Author

d1bevz commented Jan 13, 2022

I've upgraded my python to 3.6.3 and it's working

@nathaniel-may
Copy link
Contributor

Hi, @d1bevz thanks for your but report! I'm glad to hear it's working for you. I looked into it and I was able to reproduce your error with Python 3.7.0 on both dbt 0.21 and dbt 1.0.0. Since in dbt 1.0.0 we have removed support for Python 3.6, when you update dbt you'll want to use the latest Python 3.7 patch since it seems to not be a problem in Python 3.7.9.

I'm closing the ticket since the issue is resolved, however feel free to reopen if you need to.

@jeff-skoldberg
Copy link

So we can't run dbt in python 3.7.0?

@Fatal1ty
Copy link

Fatal1ty commented Oct 3, 2022

So we can't run dbt in python 3.7.0?

This compatibility issue in mashumaro was fixed in the version 3.0. dbt-core uses this version since 1.3.

@nathaniel-may you might want to consider support 3.7.0 that was deprecated in #4584

@nathaniel-may
Copy link
Contributor

@jeff-skoldberg, today dbt does not run with Python 3.7.0 nor Python 3.7.1. I have filed a new ticket to check and see if we can undo this restriction with the information @Fatal1ty has provided. In general, we recommend running dbt with the latest Python patch release if possible.

@jeff-skoldberg
Copy link

Makes sense. I have a 3.9 version that worked.
For what it's worth, I run 3.7 for all things Snowflake due to an issue I had with the snowflake-connector-python on the latest version of python. At least as of a year ago, if you had the latest version of python, you had to install an older version of the connector. I wanted the latest snowflake-connector-python so I had to use an older python to get it to work. Maybe that sorted all that out since then.

@nathaniel-may
Copy link
Contributor

@jeff-skoldberg That makes sense. dbt also lags behind the latest minor release of Python which is pretty common. For anything that doesn't support Python 3.10, using Python 3.9.14 is preferred to using Python 3.9.0 is all. Glad you were able to get it working.

@mtHB
Copy link

mtHB commented Nov 8, 2022

I think as long as this issue is not being solved documentation should not mention python minimum requirement 3.7.0 when it is just not working per default for dbt 1.0.0

@waleedaliSe
Copy link

2022-11-15 17_33_47-Select Command Prompt
I am using python version 3.7 and I am getting following issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants