marshmallow-mongoengine icon indicating copy to clipboard operation
marshmallow-mongoengine copied to clipboard

ModuleNotFoundError: No module named 'marshmallow.compat'

Open hadware opened this issue 5 years ago • 6 comments

This is the error I got from running the code example on the Readme. I tried running the tests using pytest, and I got the same error. From other repo's (marshmallow-sqlalchemy) it seems that it's a marshmallow 3.x compatibility issue.

I'm not sure how to fix this myself. Also, please, do something to enable issues on the "official" repo and push them to update the Pypi version to 0.10.

hadware avatar Sep 11 '19 17:09 hadware

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.

smalekzadeh avatar Sep 17 '19 08:09 smalekzadeh

I'll have to dive into it, haven't got the time for now, but it seems it's only used to import a with_metaclass function that can be found in some other libs.

hadware avatar Sep 17 '19 19:09 hadware

Either don't bother about python 2 compatibility and remove this or replace with

import six
# ...
class ModelSchema(six.with_metaclass(SchemaMeta, ma.Schema)):
   ...

qcho avatar Oct 01 '19 00:10 qcho

Ah with_metaclass is compatibility code for Python2? They should probably drop this and move on..

hadware avatar Oct 01 '19 13:10 hadware

Same issue, using @qcho fix solves it.

AndreMPCosta avatar Nov 23 '19 15:11 AndreMPCosta

Hi all. Just trying to run through the example in the readme.md on the homepage here results in this error. Any chance of it getting updated to work? So far I haven't been able to adapt it to the fix above. Just poking around with this lib but seems like a bug to have the example code not work.

mikeckennedy avatar Feb 19 '20 00:02 mikeckennedy