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

ModuleNotFoundError: No module named 'fields' #23

Open
rscarrera27 opened this issue Aug 10, 2018 · 1 comment
Open

ModuleNotFoundError: No module named 'fields' #23

rscarrera27 opened this issue Aug 10, 2018 · 1 comment

Comments

@rscarrera27
Copy link

rscarrera27 commented Aug 10, 2018

I write above code for using EnumField. but it raise ModuleNotFoundError: No module named 'fields'

from extras_mongoengine.fields import IntEnuField
from mongoengine import *
from enum import Enum

class Type(Enum):
    a = 1
    b = 2

class Doc(Document):
    test = IntEnumField(Type)
...
  File "/home/travis/build/Team-SeeTo/SeeTo-Backend/test.py", line 2, in <module>
    from extras_mongoengine.fields import IntEnumField
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/extras_mongoengine/__init__.py", line 1, in <module>
    import fields
ModuleNotFoundError: No module named 'fields'

and I found what is the problem, original init.py code is here,

import fields

__all__ = ('fields')

when I change like this, it works, can I make PR?

import extras_mongoengine.fields as fields

__all__ = ('fields')

thanks.

@rscarrera27
Copy link
Author

No updates yet after 1 year....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant