-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Cannot import DomainLanguage and a bunch of stuff: ImportError: cannot import name 'TableQuestionContext' from 'allennlp.semparse.contexts' #2935
Comments
I'm able to reproduce this on my mac. I'll see if I can dig into it, but if you can figure out a fix, it might be faster, and it'd be much appreciated. |
@matt-gardner makes sense. I have v0.8.3 on my mac and that works fine. Something broke between the versions. I'll try taking a look too. |
@pdasigi had a recent PR that modified the |
Yup, this is the commit that introduced the bug: Checked out the one before that and importing works. |
So the problem occurs because of this cycle:
Removing |
If |
Thanks for digging into this! I think the best solution here is to move |
@matt-gardner sure, no problem. Had to move the exception classes from |
* Move domain_languages.common to semparse.common * Move exception classes from domain_langauge.py to semparse/common/errors.py * Undo over-specific semparse.common.error import changes * Fix formatting issues * Copy over common docs to .semparse.common.rst * Fix (at least part of) the docs * Fixing docs again * Moving tests to the right place
* Move domain_languages.common to semparse.common * Move exception classes from domain_langauge.py to semparse/common/errors.py * Undo over-specific semparse.common.error import changes * Fix formatting issues * Copy over common docs to .semparse.common.rst * Fix (at least part of) the docs * Fixing docs again * Moving tests to the right place
Describe the bug
Trying to import
DomainLanguage
gives this error:But trying it again, works:
Looks like some kind of circular dependencies?
This is not happening on my Mac OS X, only on Ubuntu.
To Reproduce
Steps to reproduce the behavior
from allennlp.semparse.domain_languages.domain_language import DomainLanguage
System (please complete the following information):
The text was updated successfully, but these errors were encountered: