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

While Testing: ImportError: No module named 'allennlp' #4

Open
AdLucem opened this issue Apr 5, 2019 · 4 comments
Open

While Testing: ImportError: No module named 'allennlp' #4

AdLucem opened this issue Apr 5, 2019 · 4 comments

Comments

@AdLucem
Copy link

AdLucem commented Apr 5, 2019

Hi, and also I think your paper is awesome! Anyway, onto the issue:

I'm following your 'getting started' guide, and while running py.test -v I get this error for every single task (I'm just showing the error for word_conditional_conllu_pos_tagging_test.py:

_______ ERROR collecting tests/models/word_conditional_majority_tagger/word_conditional_conllu_pos_tagging_test.py _______
ImportError while importing test module '/home/atreyee/contextual-repr-analysis/tests/models/word_conditional_majority_tagger/word_conditional_conllu_pos_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/models/word_conditional_majority_tagger/word_conditional_conllu_pos_tagging_test.py:3: in <module>
    from contexteval.common.model_test_case import ModelTestCase
contexteval/__init__.py:1: in <module>
    from contexteval.contextualizers import *  # noqa: F401,F403
contexteval/contextualizers/__init__.py:1: in <module>
    from contexteval.contextualizers.contextualizer import Contextualizer
contexteval/contextualizers/contextualizer.py:4: in <module>
    from allennlp.common.registrable import Registrable
E   ImportError: No module named 'allennlp'

The test is run within a conda environment, set up as you recommended, with one minor difference: I used the https:// link instead of the git:// link for cloning allennlp, because I can't access git links on my network.

Nonetheless, allennlp is installed and can be accessed by the code- I tested this by test-printing Registrable from within the above contextualizer.py module, and it successfully prints <class 'allennlp.common.registrable.Registrable'>. So clearly the code can access the module, but while running tests, it can't...?

@nelson-liu
Copy link
Owner

Hi, sorry for totally missing this---I'll get back to you about this.

@Superhzf
Copy link

Any progress on this issue?

@nelson-liu
Copy link
Owner

what version of python are you using? I wasn't able to reproduce this issue, unfortunately :(

@Superhzf
Copy link

what version of python are you using? I wasn't able to reproduce this issue, unfortunately :(

I will open a new issue about this.

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

No branches or pull requests

3 participants