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

Errors when do installation #8

Closed
Superhzf opened this issue Oct 19, 2021 · 26 comments
Closed

Errors when do installation #8

Superhzf opened this issue Oct 19, 2021 · 26 comments

Comments

@Superhzf
Copy link

Superhzf commented Oct 19, 2021

Hi Liu,

When I do pip install -r requirements.txt in step 5 of installation, I got the following errors/warnings:

WARNING: Built wheel for allennlp is invalid: Metadata 1.2 mandates PEP 440 version, but '0.7.2-unreleased' is not

DEPRECATION: allennlp was installed using the legacy 'setup.py install' method, because a wheel could not be built for it. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.

Any idea how to fix this?

@Superhzf Superhzf changed the title Errors when do py.test -v Errors when do installation Oct 19, 2021
@nelson-liu
Copy link
Owner

what version of pip are you using?

@Superhzf
Copy link
Author

what version of pip are you using?

I am using pip 21.0.1.

@Superhzf
Copy link
Author

@nelson-liu Hi Nelson, would you please help me with this?

@nelson-liu
Copy link
Owner

I pushed a fix at 1550abe , can you try pulling this update and re-pip-installing?

@Superhzf
Copy link
Author

I pushed a fix at 1550abe , can you try pulling this update and re-pip-installing?

No problem, I will do it and get back to you. Thank you!

@Superhzf
Copy link
Author

Superhzf commented Oct 21, 2021

I pushed a fix at 1550abe , can you try pulling this update and re-pip-installing?

If I do overrides==1.9,
It does not work, I received the same error as before.

What I want is to generate the exact precomputing word representations HDF5 file as you did from ELMo and BERT. Can I do this without fixing this bug? If so, would you please tell me what I should run?

@nelson-liu
Copy link
Owner

Did you run pip install -r requirements.txt -U? the previous version might not have been uninstalled.

@nelson-liu
Copy link
Owner

(for more context: i was able to reproduce the issue you described, and then fixed it with that commit)

@Superhzf
Copy link
Author

Superhzf commented Oct 21, 2021

Did you run pip install -r requirements.txt -U? the previous version might not have been uninstalled.

I deleted the entire conda environment before redoing it. I will try pip install -r requirements.txt -U now and let you know

@Superhzf
Copy link
Author

Superhzf commented Oct 21, 2021

Did you run pip install -r requirements.txt -U? the previous version might not have been uninstalled.

I tested again, the same error.

(for more context: i was able to reproduce the issue you described, and then fixed it with that commit)

Did you run py.test -v after fixing the error? If I run pip install -r requirements.txt -U two times, no errors show up after the second time, but still I cannot pass test cases.

@nelson-liu
Copy link
Owner

yes, i ran py.test -v. what does pip list output?

@Superhzf
Copy link
Author

yes, i ran py.test -v. what does pip list output?

here
`Package Version


alabaster 0.7.12
allennlp 0.7.2-unreleased
attrs 21.2.0
aws-xray-sdk 0.95
awscli 1.21.0
Babel 2.9.1
boto 2.49.0
boto3 1.19.0
botocore 1.22.0
cached-property 1.5.2
certifi 2020.12.5
cffi 1.11.2
charset-normalizer 2.0.7
click 8.0.3
codecov 2.1.12
colorama 0.4.3
conllu 0.11
cookies 2.2.1
coverage 6.0.2
cryptography 3.2.1
cycler 0.10.0
cymem 2.0.5
cytoolz 0.9.0.1
dataclasses 0.8
dill 0.2.9
docker 5.0.3
docutils 0.15.2
ecdsa 0.17.0
editdistance 0.6.0
flake8 4.0.1
flaky 3.7.0
Flask 0.12.4
Flask-Cors 3.0.3
ftfy 6.0.3
future 0.18.2
gevent 1.3.6
greenlet 1.1.2
h5py 3.1.0
idna 3.3
imagesize 1.2.0
importlib-metadata 4.2.0
iniconfig 1.1.1
itsdangerous 2.0.1
Jinja2 3.0.2
jmespath 0.10.0
joblib 1.1.0
jsondiff 1.1.1
jsonnet 0.10.0
jsonpickle 2.0.0
kiwisolver 1.3.1
MarkupSafe 2.0.1
matplotlib 2.2.3
mccabe 0.6.1
mock 4.0.3
moto 1.3.4
msgpack 0.5.6
msgpack-numpy 0.4.3.2
murmurhash 1.0.5
mypy 0.910
mypy-extensions 0.4.3
nltk 3.6.3
numpy 1.19.5
numpydoc 0.8.0
overrides 1.9
packaging 21.0
pandas 1.1.5
parsimonious 0.8.0
pip 21.0.1
plac 0.9.6
pluggy 1.0.0
preshed 2.0.1
protobuf 3.19.0
py 1.10.0
pyaml 21.10.1
pyasn1 0.4.8
pycodestyle 2.8.0
pycparser 2.20
pycryptodome 3.11.0
pyflakes 2.4.0
Pygments 2.10.0
pyparsing 2.4.7
pytest 6.2.5
pytest-cov 3.0.0
python-dateutil 2.8.2
python-jose 2.0.2
pytz 2017.3
PyYAML 5.4.1
regex 2018.1.10
requests 2.26.0
responses 0.14.0
rsa 4.7.2
s3transfer 0.5.0
scikit-learn 0.20.3
scipy 1.5.4
seaborn 0.11.2
setuptools 58.0.4
six 1.16.0
snowballstemmer 2.1.0
spacy 2.0.18
Sphinx 4.2.0
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
sqlparse 0.2.4
tensorboardX 1.2
thinc 6.12.1
toml 0.10.2
tomli 1.2.1
toolz 0.11.1
torch 0.4.1
tqdm 4.62.3
typed-ast 1.4.3
typing-extensions 3.10.0.2
ujson 4.2.0
Unidecode 1.3.2
urllib3 1.26.7
wcwidth 0.2.5
websocket-client 1.2.1
Werkzeug 2.0.2
wheel 0.37.0
wrapt 1.10.11
xmltodict 0.12.0
zipp 3.6.0
The pip version is still21.0.1` :(

@nelson-liu
Copy link
Owner

what does py.test -v output? I should note that the PEP 440 warning in your top-level comment is just a warning, and doesn't affect functionality.;

@Superhzf
Copy link
Author

what does py.test -v output? I should note that the PEP 440 warning in your top-level comment is just a warning, and doesn't affect functionality.;

The output is the same as the error here #4

@nelson-liu
Copy link
Owner

hmm, not sure what else to suggest---I still can't reproduce the error in #4 . Can you send me your full py.test output? I'm getting:

$ py.test
========================================= test session starts =========================================
platform linux -- Python 3.6.13, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/nfliu/git/contextual-repr-analysis, configfile: pytest.ini, testpaths: tests/
plugins: cov-3.0.0, flaky-3.7.0
collected 1244 items

tests/common/util_test.py ..                                                                    [  0%]
tests/contextualizers/elmo_contextualizer_test.py ........                                      [  0%]
tests/contextualizers/glove_contextualizer_test.py ...                                          [  1%]
tests/contextualizers/precomputed_contextualizer_test.py .....                                  [  1%]
tests/contextualizers/scalar_mixed_precomputed_contextualizer_test.py .                         [  1%]
tests/data/dataset_readers/adposition_supersense_tagging_test.py .............................. [  3%]
............................................................................................... [ 11%]
...........                                                                                     [ 12%]
tests/data/dataset_readers/ccg_supertagging_test.py ..................................          [ 15%]
tests/data/dataset_readers/conjunct_identification_test.py ..................................   [ 17%]
tests/data/dataset_readers/conll2000_chunking_test.py ..................................        [ 20%]
tests/data/dataset_readers/conll2003_ner_test.py ......................................         [ 23%]
tests/data/dataset_readers/conllu_pos_test.py ..................................                [ 26%]
tests/data/dataset_readers/conllx_pos_test.py ..................................                [ 29%]
tests/data/dataset_readers/constituency_ancestor_prediction_test.py ........................... [ 31%]
.......................................................                                         [ 35%]
tests/data/dataset_readers/coreference_arc_prediction_test.py ................................  [ 38%]
tests/data/dataset_readers/event_factuality_test.py ........................................... [ 41%]
.........................                                                                       [ 43%]
tests/data/dataset_readers/grammatical_error_correction_test.py ............................... [ 46%]
...                                                                                             [ 46%]
tests/data/dataset_readers/language_modeling_test.py .......................................... [ 49%]
..........................................................                                      [ 54%]
tests/data/dataset_readers/semantic_dependency_arc_classification_test.py ..................... [ 56%]
............................................................................................... [ 63%]
................                                                                                [ 65%]
tests/data/dataset_readers/semantic_dependency_arc_prediction_test.py ......................... [ 67%]
...............................................                                                 [ 70%]
tests/data/dataset_readers/semantic_tagging_test.py ..................................          [ 73%]
tests/data/dataset_readers/syntactic_dependency_arc_classification_test.py .................... [ 75%]
............................................................................................... [ 82%]
.................                                                                               [ 84%]
tests/data/dataset_readers/syntactic_dependency_arc_prediction_test.py ........................ [ 86%]
................................................                                                [ 90%]
tests/models/pairwise_tagger/coreference_arc_prediction_test.py .....                           [ 90%]
tests/models/pairwise_tagger/semantic_dependency_arc_classification_test.py ......              [ 90%]
tests/models/pairwise_tagger/semantic_dependency_arc_prediction_test.py .....                   [ 91%]
tests/models/pairwise_tagger/syntactic_dependency_arc_classification_test.py .....              [ 91%]
tests/models/pairwise_tagger/syntactic_dependency_arc_prediction_test.py ......                 [ 92%]
tests/models/pairwise_tagger/transfer_from_pretrained_file_test.py ...                          [ 92%]
tests/models/selective_regressor/event_factuality_test.py .....                                 [ 92%]
tests/models/selective_regressor/transfer_from_pretrained_file_test.py ...                      [ 93%]
tests/models/selective_tagger/adposition_supersense_tagging_test.py ........                    [ 93%]
tests/models/selective_tagger/transfer_from_pretrained_file_test.py ...                         [ 94%]
tests/models/tagger/ccg_supertagging_test.py .....                                              [ 94%]
tests/models/tagger/conjunct_identification_test.py .....                                       [ 94%]
tests/models/tagger/conll2000_chunking_test.py ......                                           [ 95%]
tests/models/tagger/conll2003_ner_test.py ......                                                [ 95%]
tests/models/tagger/conllu_pos_tagging_test.py .....                                            [ 96%]
tests/models/tagger/conllx_pos_tagging_test.py .....                                            [ 96%]
tests/models/tagger/constituency_ancestor_prediction_test.py ............                       [ 97%]
tests/models/tagger/grammatical_error_correction_test.py .....                                  [ 97%]
tests/models/tagger/language_modeling_test.py .....s.                                           [ 98%]
tests/models/tagger/semantic_tagging_test.py ......                                             [ 99%]
tests/models/tagger/transfer_from_pretrained_file_test.py ...                                   [ 99%]
tests/models/word_conditional_majority_pairwise_tagger/word_conditional_coreference_arc_prediction_test.py . [ 99%]
..                                                                                              [ 99%]
tests/models/word_conditional_majority_selective_tagger/word_conditional_adposition_supersense_tagging_test.py . [ 99%]
..                                                                                              [ 99%]
tests/models/word_conditional_majority_tagger/word_conditional_conllu_pos_tagging_test.py ...   [100%]

========================================== warnings summary ===========================================
../../miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/plac_ext.py:6
  /home/nfliu/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/plac_ext.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

../../miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/allennlp/service/predictors/__init__.py:23
  /home/nfliu/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/allennlp/service/predictors/__init__.py:23: FutureWarning: allennlp.service.predictors.* has been depreciated. Please use allennlp.predictors.*
    "Please use allennlp.predictors.*", FutureWarning)

../../miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/allennlp/service/predictors/predictor.py:6
  /home/nfliu/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/allennlp/service/predictors/predictor.py:6: FutureWarning: allennlp.service.predictors.* has been deprecated. Please use allennlp.predictors.*
    " Please use allennlp.predictors.*", FutureWarning)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
===Flaky Test Report===

test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_forward_pass_runs_correctly passed 1 out of the required 1 times. Success!
test_batch_classifications_are_consistent passed 1 out of the required 1 times. Success!
test_forward_pass_runs_correctly passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_forward_pass_runs_correctly passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_forward_pass_runs_correctly passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_forward_pass_runs_correctly passed 1 out of the required 1 times. Success!
test_tagger_transfer_contextualizer passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder_and_contextualizer passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_tagger_transfer_contextualizer passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder_and_contextualizer passed 1 out of the required 1 times. Success!
test_batch_classifications_are_consistent passed 1 out of the required 1 times. Success!
test_forward_pass_runs_correctly passed 1 out of the required 1 times. Success!
test_tagger_transfer_contextualizer passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder_and_contextualizer passed 1 out of the required 1 times. Success!
test_simple_tagger_backward_can_train_save_and_load passed 1 out of the required 1 times. Success!
test_simple_tagger_forward_can_train_save_and_load passed 1 out of the required 1 times. Success!
test_simple_tagger_with_forward_contextualizer_can_train_save_and_load passed 1 out of the required 1 times. Success!
test_tagger_transfer_contextualizer passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder passed 1 out of the required 1 times. Success!
test_tagger_transfer_encoder_and_contextualizer passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!

===End Flaky Test Report===
============================ 1243 passed, 1 skipped, 3 warnings in 56.31s =============================

@Superhzf
Copy link
Author

Here you go!

============================= test session starts ==============================
platform darwin -- Python 3.8.10, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8
cachedir: .pytest_cache
rootdir: /Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master, configfile: pytest.ini, testpaths: tests/
plugins: flaky-3.7.0
collected 0 items / 46 errors                                                  

==================================== ERRORS ====================================
__________________ ERROR collecting tests/common/util_test.py __________________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/common/util_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/common/util_test.py:5: in <module>
    from contexteval.common.custom_test_case import CustomTestCase
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   ModuleNotFoundError: No module named 'allennlp'
______ ERROR collecting tests/contextualizers/elmo_contextualizer_test.py ______
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/contextualizers/elmo_contextualizer_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/contextualizers/elmo_contextualizer_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_____ ERROR collecting tests/contextualizers/glove_contextualizer_test.py ______
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/contextualizers/glove_contextualizer_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/contextualizers/glove_contextualizer_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
__ ERROR collecting tests/contextualizers/precomputed_contextualizer_test.py ___
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/contextualizers/precomputed_contextualizer_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/contextualizers/precomputed_contextualizer_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/contextualizers/scalar_mixed_precomputed_contextualizer_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/contextualizers/scalar_mixed_precomputed_contextualizer_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/contextualizers/scalar_mixed_precomputed_contextualizer_test.py:4: in <module>
    from contexteval.contextualizers import ScalarMixedPrecomputedContextualizer
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   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/adposition_supersense_tagging_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/adposition_supersense_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/adposition_supersense_tagging_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_____ ERROR collecting tests/data/dataset_readers/ccg_supertagging_test.py _____
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/ccg_supertagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/ccg_supertagging_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/conjunct_identification_test.py __
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/conjunct_identification_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/conjunct_identification_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
____ ERROR collecting tests/data/dataset_readers/conll2000_chunking_test.py ____
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/conll2000_chunking_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/conll2000_chunking_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
______ ERROR collecting tests/data/dataset_readers/conll2003_ner_test.py _______
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/conll2003_ner_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/conll2003_ner_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
________ ERROR collecting tests/data/dataset_readers/conllu_pos_test.py ________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/conllu_pos_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/conllu_pos_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
________ ERROR collecting tests/data/dataset_readers/conllx_pos_test.py ________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/conllx_pos_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/conllx_pos_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/constituency_ancestor_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/constituency_ancestor_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/constituency_ancestor_prediction_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/coreference_arc_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/coreference_arc_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/coreference_arc_prediction_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_____ ERROR collecting tests/data/dataset_readers/event_factuality_test.py _____
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/event_factuality_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/event_factuality_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/grammatical_error_correction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/grammatical_error_correction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/grammatical_error_correction_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
____ ERROR collecting tests/data/dataset_readers/language_modeling_test.py _____
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/language_modeling_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/language_modeling_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/semantic_dependency_arc_classification_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/semantic_dependency_arc_classification_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/semantic_dependency_arc_classification_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/semantic_dependency_arc_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/semantic_dependency_arc_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/semantic_dependency_arc_prediction_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_____ ERROR collecting tests/data/dataset_readers/semantic_tagging_test.py _____
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/semantic_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/semantic_tagging_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/syntactic_dependency_arc_classification_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/syntactic_dependency_arc_classification_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/syntactic_dependency_arc_classification_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/data/dataset_readers/syntactic_dependency_arc_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/data/dataset_readers/syntactic_dependency_arc_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/data/dataset_readers/syntactic_dependency_arc_prediction_test.py:1: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/pairwise_tagger/coreference_arc_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/pairwise_tagger/coreference_arc_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/pairwise_tagger/coreference_arc_prediction_test.py:4: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/pairwise_tagger/semantic_dependency_arc_classification_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/pairwise_tagger/semantic_dependency_arc_classification_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/pairwise_tagger/semantic_dependency_arc_classification_test.py:4: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/pairwise_tagger/semantic_dependency_arc_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/pairwise_tagger/semantic_dependency_arc_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/pairwise_tagger/semantic_dependency_arc_prediction_test.py:4: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/pairwise_tagger/syntactic_dependency_arc_classification_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/pairwise_tagger/syntactic_dependency_arc_classification_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/pairwise_tagger/syntactic_dependency_arc_classification_test.py:4: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/pairwise_tagger/syntactic_dependency_arc_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/pairwise_tagger/syntactic_dependency_arc_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/pairwise_tagger/syntactic_dependency_arc_prediction_test.py:4: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/pairwise_tagger/transfer_from_pretrained_file_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/pairwise_tagger/transfer_from_pretrained_file_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/pairwise_tagger/transfer_from_pretrained_file_test.py:4: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
__ ERROR collecting tests/models/selective_regressor/event_factuality_test.py __
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/selective_regressor/event_factuality_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/selective_regressor/event_factuality_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/selective_regressor/transfer_from_pretrained_file_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/selective_regressor/transfer_from_pretrained_file_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/selective_regressor/transfer_from_pretrained_file_test.py:4: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/selective_tagger/adposition_supersense_tagging_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/selective_tagger/adposition_supersense_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/selective_tagger/adposition_supersense_tagging_test.py:4: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/selective_tagger/transfer_from_pretrained_file_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/selective_tagger/transfer_from_pretrained_file_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/selective_tagger/transfer_from_pretrained_file_test.py:4: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
________ ERROR collecting tests/models/tagger/ccg_supertagging_test.py _________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/ccg_supertagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/ccg_supertagging_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_____ ERROR collecting tests/models/tagger/conjunct_identification_test.py _____
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/conjunct_identification_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/conjunct_identification_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_______ ERROR collecting tests/models/tagger/conll2000_chunking_test.py ________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/conll2000_chunking_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/conll2000_chunking_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
__________ ERROR collecting tests/models/tagger/conll2003_ner_test.py __________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/conll2003_ner_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/conll2003_ner_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_______ ERROR collecting tests/models/tagger/conllu_pos_tagging_test.py ________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/conllu_pos_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/conllu_pos_tagging_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_______ ERROR collecting tests/models/tagger/conllx_pos_tagging_test.py ________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/conllx_pos_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/conllx_pos_tagging_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/tagger/constituency_ancestor_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/constituency_ancestor_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/constituency_ancestor_prediction_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
__ ERROR collecting tests/models/tagger/grammatical_error_correction_test.py ___
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/grammatical_error_correction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/grammatical_error_correction_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
________ ERROR collecting tests/models/tagger/language_modeling_test.py ________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/language_modeling_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/language_modeling_test.py:4: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
________ ERROR collecting tests/models/tagger/semantic_tagging_test.py _________
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/semantic_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/semantic_tagging_test.py:3: in <module>
    from allennlp.common.checks import ConfigurationError
E   ModuleNotFoundError: No module named 'allennlp'
__ ERROR collecting tests/models/tagger/transfer_from_pretrained_file_test.py __
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/tagger/transfer_from_pretrained_file_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/tagger/transfer_from_pretrained_file_test.py:4: in <module>
    from allennlp.common import Params
E   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/word_conditional_majority_pairwise_tagger/word_conditional_coreference_arc_prediction_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/word_conditional_majority_pairwise_tagger/word_conditional_coreference_arc_prediction_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/word_conditional_majority_pairwise_tagger/word_conditional_coreference_arc_prediction_test.py:4: 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   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/word_conditional_majority_selective_tagger/word_conditional_adposition_supersense_tagging_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/tests/models/word_conditional_majority_selective_tagger/word_conditional_adposition_supersense_tagging_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/models/word_conditional_majority_selective_tagger/word_conditional_adposition_supersense_tagging_test.py:2: 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   ModuleNotFoundError: No module named 'allennlp'
_ ERROR collecting tests/models/word_conditional_majority_tagger/word_conditional_conllu_pos_tagging_test.py _
ImportError while importing test module '/Users/zefuhu/Documents/workspace/papers/PhD_research/NLP/implementation-similarly-analysis/contextual-repr-analysis-master/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:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
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   ModuleNotFoundError: No module named 'allennlp'
=========================== short test summary info ============================
ERROR tests/common/util_test.py
ERROR tests/contextualizers/elmo_contextualizer_test.py
ERROR tests/contextualizers/glove_contextualizer_test.py
ERROR tests/contextualizers/precomputed_contextualizer_test.py
ERROR tests/contextualizers/scalar_mixed_precomputed_contextualizer_test.py
ERROR tests/data/dataset_readers/adposition_supersense_tagging_test.py
ERROR tests/data/dataset_readers/ccg_supertagging_test.py
ERROR tests/data/dataset_readers/conjunct_identification_test.py
ERROR tests/data/dataset_readers/conll2000_chunking_test.py
ERROR tests/data/dataset_readers/conll2003_ner_test.py
ERROR tests/data/dataset_readers/conllu_pos_test.py
ERROR tests/data/dataset_readers/conllx_pos_test.py
ERROR tests/data/dataset_readers/constituency_ancestor_prediction_test.py
ERROR tests/data/dataset_readers/coreference_arc_prediction_test.py
ERROR tests/data/dataset_readers/event_factuality_test.py
ERROR tests/data/dataset_readers/grammatical_error_correction_test.py
ERROR tests/data/dataset_readers/language_modeling_test.py
ERROR tests/data/dataset_readers/semantic_dependency_arc_classification_test.py
ERROR tests/data/dataset_readers/semantic_dependency_arc_prediction_test.py
ERROR tests/data/dataset_readers/semantic_tagging_test.py
ERROR tests/data/dataset_readers/syntactic_dependency_arc_classification_test.py
ERROR tests/data/dataset_readers/syntactic_dependency_arc_prediction_test.py
ERROR tests/models/pairwise_tagger/coreference_arc_prediction_test.py
ERROR tests/models/pairwise_tagger/semantic_dependency_arc_classification_test.py
ERROR tests/models/pairwise_tagger/semantic_dependency_arc_prediction_test.py
ERROR tests/models/pairwise_tagger/syntactic_dependency_arc_classification_test.py
ERROR tests/models/pairwise_tagger/syntactic_dependency_arc_prediction_test.py
ERROR tests/models/pairwise_tagger/transfer_from_pretrained_file_test.py
ERROR tests/models/selective_regressor/event_factuality_test.py
ERROR tests/models/selective_regressor/transfer_from_pretrained_file_test.py
ERROR tests/models/selective_tagger/adposition_supersense_tagging_test.py
ERROR tests/models/selective_tagger/transfer_from_pretrained_file_test.py
ERROR tests/models/tagger/ccg_supertagging_test.py
ERROR tests/models/tagger/conjunct_identification_test.py
ERROR tests/models/tagger/conll2000_chunking_test.py
ERROR tests/models/tagger/conll2003_ner_test.py
ERROR tests/models/tagger/conllu_pos_tagging_test.py
ERROR tests/models/tagger/conllx_pos_tagging_test.py
ERROR tests/models/tagger/constituency_ancestor_prediction_test.py
ERROR tests/models/tagger/grammatical_error_correction_test.py
ERROR tests/models/tagger/language_modeling_test.py
ERROR tests/models/tagger/semantic_tagging_test.py
ERROR tests/models/tagger/transfer_from_pretrained_file_test.py
ERROR tests/models/word_conditional_majority_pairwise_tagger/word_conditional_coreference_arc_prediction_test.py
ERROR tests/models/word_conditional_majority_selective_tagger/word_conditional_adposition_supersense_tagging_test.py
ERROR tests/models/word_conditional_majority_tagger/word_conditional_conllu_pos_tagging_test.py
!!!!!!!!!!!!!!!!!!! Interrupted: 46 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 46 errors in 1.01s =================

@Superhzf
Copy link
Author

Not sure why I ran this in the conda environment but the Python version is 3.8 instead of 3.6.

@nelson-liu
Copy link
Owner

nelson-liu commented Oct 21, 2021

Looks like your python is pointing to your system python (/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8), and this is the one that py.test is using. When installing the environment, did you use:

conda create -n contextual_repr_analysis python=3.6

the python=3.6 is very important.

I'd expect that if you ran which python, it'd point to the OS system python. I think your $PATH might be a bit off, and that the system python is earlier in the $PATH than the conda environment python. Maybe https://askubuntu.com/a/886990 would help?

@Superhzf
Copy link
Author

Looks like your python is pointing to your system python (/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8), and this is the one that py.test is using. When installing the environment, did you use:

conda create -n contextual_repr_analysis python=3.6

the python=3.6 is very important.

I'd expect that if you ran which python, it'd point to the OS system python. I think your $PATH might be a bit off, and that the system python is earlier in the $PATH than the conda environment python. Maybe https://askubuntu.com/a/886990 would help?

If I run which python, it returns /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/bin/python which seems to be correct.

Then, if I run python, then I got

import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/__init__.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__init__.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/__init__.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/codecs.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/codecs.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/codecs.cpython-36.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed18020828>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/aliases.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/aliases.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/aliases.cpython-36.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed18038358>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed18020390>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/utf_8.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/utf_8.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/utf_8.cpython-36.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed18045160>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/latin_1.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/latin_1.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/encodings/__pycache__/latin_1.cpython-36.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed18045be0>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/io.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/io.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/io.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/abc.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/abc.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/abc.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_weakrefset.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/_weakrefset.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_weakrefset.cpython-36.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed1804cb38>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed1804c1d0>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed18045dd8>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/site.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/site.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/os.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/os.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/os.cpython-36.pyc'
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/stat.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/stat.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/stat.cpython-36.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed180f2828>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/posixpath.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/posixpath.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/posixpath.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/genericpath.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/genericpath.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/genericpath.cpython-36.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed180fb240>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed180f2ef0>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_collections_abc.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/_collections_abc.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_collections_abc.cpython-36.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed180fb860>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed180e1748>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_sitebuiltins.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/_sitebuiltins.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_sitebuiltins.cpython-36.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed180e1b38>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sysconfig.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/sysconfig.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sysconfig.cpython-36.pyc'
import 'sysconfig' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0803bcf8>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_sysconfigdata_m_darwin_darwin.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/_sysconfigdata_m_darwin_darwin.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_sysconfigdata_m_darwin_darwin.cpython-36.pyc'
import '_sysconfigdata_m_darwin_darwin' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0804e588>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_osx_support.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/_osx_support.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_osx_support.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/re.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/re.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/re.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/enum.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/enum.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/enum.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/types.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/types.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/types.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/functools.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/functools.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/functools.cpython-36.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/collections/__pycache__/__init__.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/collections/__init__.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/collections/__pycache__/__init__.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/operator.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/operator.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/operator.cpython-36.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080f2fd0>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/keyword.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/keyword.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/keyword.cpython-36.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed08104240>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/heapq.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/heapq.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/heapq.cpython-36.pyc'
# extension module '_heapq' loaded from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/lib-dynload/_heapq.cpython-36m-darwin.so'
# extension module '_heapq' executed from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/lib-dynload/_heapq.cpython-36m-darwin.so'
import '_heapq' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fed08104f60>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed08104a58>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/reprlib.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/reprlib.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/reprlib.cpython-36.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0810e080>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080b4748>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/weakref.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/weakref.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/weakref.cpython-36.pyc'
import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080b4b38>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080a60b8>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/collections/__pycache__/abc.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/collections/abc.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/collections/__pycache__/abc.cpython-36.pyc'
import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080a6ef0>
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0809c390>
import 'enum' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080673c8>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sre_compile.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/sre_compile.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sre_compile.cpython-36.pyc'
import '_sre' # <class '_frozen_importlib.BuiltinImporter'>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sre_parse.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/sre_parse.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sre_parse.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sre_constants.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/sre_constants.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/sre_constants.cpython-36.pyc'
import 'sre_constants' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0813f358>
import 'sre_parse' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed08129f28>
import 'sre_compile' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080a6358>
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/copyreg.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/copyreg.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/copyreg.cpython-36.pyc'
import 'copyreg' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0814f048>
import 're' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed08062278>
import '_osx_support' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0805a518>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_bootlocale.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/_bootlocale.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/_bootlocale.cpython-36.pyc'
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed080672b0>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/__init__.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__init__.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/__init__.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/warnings.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/warnings.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/warnings.cpython-36.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0814fb00>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0814f710>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/util.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/util.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/util.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/abc.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/abc.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/abc.cpython-36.pyc'
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/machinery.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/machinery.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/importlib/__pycache__/machinery.cpython-36.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed08165240>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0815cb38>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/contextlib.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/contextlib.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/contextlib.cpython-36.pyc'
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed08165eb8>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0815c160>
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/mpl_toolkits
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/mpl_toolkits
# destroy mpl_toolkits
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/google
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/sphinxcontrib
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/sphinxcontrib
# destroy sphinxcontrib
# possible namespace for /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/site-packages/sphinxcontrib
# destroy sphinxcontrib
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed1805b4a8>
Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 12:58:59) 
[GCC Clang 10.0.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
# extension module 'readline' loaded from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/lib-dynload/readline.cpython-36m-darwin.so'
# extension module 'readline' executed from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/lib-dynload/readline.cpython-36m-darwin.so'
import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fed0818aa90>
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/rlcompleter.cpython-36.pyc matches /Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/rlcompleter.py
# code object from '/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/lib/python3.6/__pycache__/rlcompleter.cpython-36.pyc'
import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0x7fed0818aba8>
>>> 

It seems to be correct too

@Superhzf
Copy link
Author

Superhzf commented Oct 21, 2021

I did have py.test installed on my system before (outside of the conda environment), does this matter?

@nelson-liu
Copy link
Owner

yes, that matters a lot. py.test is tied to the python that it was installed with---you'll need to install it in your environment as well. if you do echo $PATH, it's possible that this py.test is before the conda py.test. which py.test probably points to the py.test outside of the conda environment

@Superhzf
Copy link
Author

Superhzf commented Oct 21, 2021

Yes, as you said, py.test in the environment points to the outside Python.

I will edit the file and try again.

@nelson-liu
Copy link
Owner

even if it's installed in your environment, it isn't being used because bash finds the py.test executable at an earlier location in the $PATH (the one pointed to by which py.test). I'd recommend cleaning up your python installations (putting the conda one first in the $PATH) and trying again.

@Superhzf
Copy link
Author

even if it's installed in your environment, it isn't being used because bash finds the py.test executable at an earlier location in the $PATH (the one pointed to by which py.test). I'd recommend cleaning up your python installations (putting the conda one first in the $PATH) and trying again.

Thank you!

/Users/zefuhu/opt/miniconda3/envs/contextual_repr_analysis/bin:
/Users/zefuhu/opt/miniconda3/condabin:
/Library/Frameworks/Python.framework/Versions/3.8/bin:
/usr/local/bin:
/usr/bin:/bin:
/usr/sbin:
/sbin:
/Users/zefuhu/Library/Python/3.7/bin:
/Applications/VMware Fusion.app/Contents/Public:
/Library/TeX/texbin:
/Applications/Postgres.app/Contents/Versions/latest/bin

Here is the output of echo $PATH, it looks like miniconda3 has been already at the top?

@Superhzf
Copy link
Author

If I run which py.test outside of the environment, it returns /Users/zefuhu/opt/miniconda3/bin/py.test.
However, if I run which py.test in the environment, it returns /Library/Frameworks/Python.framework/Versions/3.8/bin/py.test

I'm confused..

@Superhzf
Copy link
Author

even if it's installed in your environment, it isn't being used because bash finds the py.test executable at an earlier location in the $PATH (the one pointed to by which py.test). I'd recommend cleaning up your python installations (putting the conda one first in the $PATH) and trying again.

This morning I tried again and which py.test can point to the Python in the environment. It's weird, probably because I restarted my machine? Anyway, thank you! @nelson-liu

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

2 participants