ModuleNotFoundError: No module named 'marshmallow.compat' with marshmallow 3.0.0rc6 installed
Closed this issue · 7 comments
Executing the JSONSchema example
from marshmallow import Schema, fields
from marshmallow_jsonschema import JSONSchema
class UserSchema(Schema):
username = fields.String()
age = fields.Integer()
birthday = fields.Date()
user_schema = UserSchema()
json_schema = JSONSchema()
json_schema.dump(user_schema).data
with marshmallow 3.0.0rc6 installed yields
ModuleNotFoundError: No module named 'marshmallow.compat'
AFAIS the module marshmallow.compat
is gone with version 3.0.0. (cf. file finder)
Looks legit! I'll take a look soon unless someone beats me to it!
This library will need to be forward / backward compatible with 2 & 3 for a little bit I think, since the amount of breaking changes in marshmallow 3 are starting to stack up pretty high.
Any idea how I could work around?
Thanks a lot 👍
We are trying to upgrade from 2.19.2 to 3.1.1 and get the same error . Could you please advice how to get around it.
from flask_apispec import ResourceMeta
venv/lib/python3.6/site-packages/flask_apispec/init.py:2: in
from flask_apispec.views import ResourceMeta, MethodResource
venv/lib/python3.6/site-packages/flask_apispec/views.py:6: in
from flask_apispec.annotations import activate
venv/lib/python3.6/site-packages/flask_apispec/annotations.py:6: in
from flask_apispec.wrapper import Wrapper
venv/lib/python3.6/site-packages/flask_apispec/wrapper.py:8: in
from webargs import flaskparser
venv/lib/python3.6/site-packages/webargs/init.py:8: in
from webargs.core import dict2schema, ValidationError
venv/lib/python3.6/site-packages/webargs/core.py:23: in
from marshmallow.compat import iteritems
E ModuleNotFoundError: No module named 'marshmallow.compat'
@fuhrysteve This is still not compatible with marshmallow version 3
File "<stdin>", line 1, in <module>
File "{{path}}/run.py", line 5, in <module>
from marshmallow_mongoengine import ModelSchema
File "{{path}}/venv/lib/python3.7/site-packages/marshmallow_mongoengine/__init__.py", line 11, in <module>
from marshmallow_mongoengine.schema import (
File "/{{path}}/venv/lib/python3.7/site-packages/marshmallow_mongoengine/schema.py", line 6, in <module>
from marshmallow.compat import with_metaclass
ModuleNotFoundError: No module named 'marshmallow.compat'
Still facing the issue.
@RORONOA007 I'm not going to get around to fixing it for awhile unfortunately! But I can review & merge pull requests