question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'sqlalchemy.dialects.postgresql' has no attribute 'MONEY' with python3.7.3 and marshmallow-sqlalchemy==0.23.1

See original GitHub issue

sqlalchemy==1.3.19 marshmallow-sqlalchemy==0.23.1 ➜ ~ python3 --version Python 3.7.3 mac os

➜ ~ sudo  pip3 install marshmallow-sqlalchemy==0.23.1
WARNING: The directory '/Users/jax/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting marshmallow-sqlalchemy==0.23.1
  Downloading marshmallow_sqlalchemy-0.23.1-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: marshmallow>=2.15.2 in /Library/Python/3.7/site-packages (from marshmallow-sqlalchemy==0.23.1) (2.21.0)
Requirement already satisfied: SQLAlchemy>=1.2.0 in /Library/Python/3.7/site-packages (from marshmallow-sqlalchemy==0.23.1) (1.3.19)
Installing collected packages: marshmallow-sqlalchemy
  Attempting uninstall: marshmallow-sqlalchemy
    Found existing installation: marshmallow-sqlalchemy 0.23.0
    Uninstalling marshmallow-sqlalchemy-0.23.0:
      Successfully uninstalled marshmallow-sqlalchemy-0.23.0
Successfully installed marshmallow-sqlalchemy-0.23.1
➜ ~ python3 --version
Python 3.7.3
➜ ~ sudo  pip3 install sqlalchemy
Password:
WARNING: The directory '/Users/jax/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: sqlalchemy in /Library/Python/3.7/site-packages (1.3.19)
➜ ~
/usr/local/bin/python3.7 /Users/jax/xx/github/airflow/airflow/__main__.py db init
DB: postgresql://postgres:***@******/airflow_mac
[2020-08-22 19:50:09,673] {db.py:619} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Traceback (most recent call last):
  File "/Users/jax/xx/github/airflow/airflow/__main__.py", line 44, in <module>
    main()
  File "/Users/jax/xx/github/airflow/airflow/__main__.py", line 40, in main
    args.func(args)
  File "/Users/jax/xx/github/airflow/airflow/cli/cli_parser.py", line 53, in command
    return func(*args, **kwargs)
  File "/Users/jax/xx/github/airflow/airflow/cli/commands/db_command.py", line 31, in initdb
    db.initdb()
  File "/Users/jax/xx/github/airflow/airflow/utils/db.py", line 569, in initdb
    from flask_appbuilder.models.sqla import Base
  File "/usr/local/lib/python3.7/site-packages/Flask_AppBuilder-3.0.1-py3.7.egg/flask_appbuilder/__init__.py", line 5, in <module>
    from .api import ModelRestApi  # noqa: F401
  File "/usr/local/lib/python3.7/site-packages/Flask_AppBuilder-3.0.1-py3.7.egg/flask_appbuilder/api/__init__.py", line 15, in <module>
    from marshmallow_sqlalchemy.fields import Related, RelatedList
  File "/Library/Python/3.7/site-packages/marshmallow_sqlalchemy/__init__.py", line 1, in <module>
    from .schema import (
  File "/Library/Python/3.7/site-packages/marshmallow_sqlalchemy/schema/__init__.py", line 1, in <module>
    from .model_schema import ModelSchema, ModelSchemaOpts, ModelSchemaMeta
  File "/Library/Python/3.7/site-packages/marshmallow_sqlalchemy/schema/model_schema.py", line 5, in <module>
    from ..convert import ModelConverter
  File "/Library/Python/3.7/site-packages/marshmallow_sqlalchemy/convert.py", line 38, in <module>
    class ModelConverter:
  File "/Library/Python/3.7/site-packages/marshmallow_sqlalchemy/convert.py", line 56, in ModelConverter
    postgresql.MONEY: fields.Decimal,
AttributeError: module 'sqlalchemy.dialects.postgresql' has no attribute 'MONEY'

Process finished with exit code 1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xu-xiangcommented, Aug 24, 2020

I have try recreated virtualenv and run this code . I’m also unable to reproduce this. It seems to be working - -

0reactions
sloriacommented, Aug 23, 2020

I’m still unable to reproduce this. It doesn’t appear to be an issue with marshmallow-sqlalchemy. More likely it is in issue with the virtualenv on your mac. Maybe try recreating it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'sqlalchemy.dialects.postgresql' has no ...
Hi , After today's release we are getting the below error when starting the airflow server.We are using amazon-linux-extras install ...
Read more >
no attribute for sqlalchemy.dialects.postgresql but files exist
UUID() but I am getting the error module sqlalchemy.dialects has no attribute postgresql . which is surprising because I can see that the...
Read more >
PostgreSQL - SQLAlchemy 1.4 Documentation
When SQLAlchemy issues a single INSERT statement, to fulfill the contract of having the “last insert identifier” available, a RETURNING clause is added...
Read more >
sqlalchemy.dialects postgresql Example Code
Python example code that shows how to use the postgresql callable from the sqlalchemy.dialects module of the SQLAlchemy project.
Read more >
AttributeError("module 'sqlalchemy' has no attribute 'dialects'"
Hello! Thank you for the previous answer. I use prefect and dask to execute workflows, that use SA inside and I get very...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found