deets
deets

Reputation: 43

Having issues accessing `SQLAlchemyAutoSchema` from flask-marshmallow, though I have the latest version of flask-marshmallow installed

I've tried various versions of flask-marshmallow, and have installed and uninstalled the latest version as well. As you can see below, I've also verified that I'm using the latest version which should have SQLAlchemyAutoSchema but I'm not able to access it.

>>> import flask_marshmallow
>>> dir(flask_marshmallow)
['EXTENSION_NAME', 'LooseVersion', 'Marshmallow', 'Schema', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '__version_info__', '__warningregistry__', '_attach_fields', 'base_fields', 'compat', 'exceptions', 'fields', 'flask_sqlalchemy', 'has_sqla', 'pprint', 'schema', 'warnings']
>>> flask_marshmallow.__version__
'0.12.0'
>>> flask_marshmallow.Marshmallow()
<flask_marshmallow.Marshmallow object at 0x10300de48>
>>> flask_marshmallow.Marshmallow().SQLAlchemyAutoSchema
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Marshmallow' object has no attribute 'SQLAlchemyAutoSchema'

I'm out of ideas on what could be causing this. Anyone seen this before?

Upvotes: 2

Views: 2084

Answers (2)

John Coben
John Coben

Reputation: 21

I solved this by installing 'marshmallow-sqlalchemy'

Upvotes: 1

Lionel Hamayon
Lionel Hamayon

Reputation: 1330

This does not apply to you, but I have got the same error while tinkering on a test project with barebone SQLAlchemy instead of Flask-SQLAlchemy.

Installing Flask-SQLAlchemy solved the error.

Upvotes: 1

Related Questions