dwadden / dygiepp

Span-based system for named entity, relation, and event extraction.
MIT License
569 stars 120 forks source link

Dependency conflicts cause broken environment when installing by instructions in README #112

Closed serenalotreck closed 1 year ago

serenalotreck commented 1 year ago

I'm going to work on this right now and see if I can't get a working environment, I'll open a PR with a new requirements.txt if I can, just wanted to put this out here in case anyone else is having this issue.

Conda version: conda 23.3.1

Steps to reproduce:

conda create --name dygiepp python=3.7
conda activate dygiepp
pip install -r requirements.txt
conda develop .

Output:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. Thi
s behaviour is the source of the following dependency conflicts.
textract 1.6.5 requires chardet==3.*, which is not installed.
textract 1.6.5 requires xlrd~=1.2.0, which is not installed.
pdfminer-six 20191110 requires chardet; python_version > "3.0", which is not installed.
matplotlib 3.5.3 requires pillow>=6.2.0, which is not installed.
matplotlib 3.5.3 requires pyparsing>=2.2.1, which is not installed.
ipykernel 6.16.2 requires psutil, which is not installed.
gradio 3.25.0 requires pillow, which is not installed.
textract 1.6.5 requires six~=1.12.0, but you have six 1.16.0 which is incompatible.
taxonerd 1.5.1 requires click<7.2.0,>=7.1.1, but you have click 8.1.3 which is incompatible.
taxonerd 1.5.1 requires spacy<3.5.0,>3.4.0, but you have spacy 2.1.9 which is incompatible.
stanford-openie 1.3.1 requires protobuf<=3.20, but you have protobuf 3.20.3 which is incompatible.
spacy-transformers 1.1.9 requires spacy<4.0.0,>=3.4.0, but you have spacy 2.1.9 which is incompatible.
spacy-transformers 1.1.9 requires srsly<3.0.0,>=2.4.0, but you have srsly 1.0.6 which is incompatible.
spacy-transformers 1.1.9 requires transformers<4.26.0,>=3.4.0, but you have transformers 3.0.2 which is incomp
atible.
scispacy 0.5.1 requires spacy<3.5.0,>=3.4.0, but you have spacy 2.1.9 which is incompatible.
en-core-eco-biobert 1.0.2 requires spacy<3.5.0,>=3.4.1, but you have spacy 2.1.9 which is incompatible.
benepar 0.2.0 requires tokenizers>=0.9.4, but you have tokenizers 0.8.1rc1 which is incompatible.
benepar 0.2.0 requires transformers[tokenizers,torch]>=4.2.2, but you have transformers 3.0.2 which is incompa
tible.
Successfully installed allennlp-1.1.0 conllu-4.1 exceptiongroup-1.1.1 filelock-3.0.12 future-0.18.3 iniconfig-
2.0.0 joblib-1.2.0 pluggy-1.0.0 protobuf-3.20.3 pytest-7.3.1 pytz-2023.3 scipy-1.7.3 six-1.16.0 torch-1.6.0 ur
llib3-1.26.16

If you try to make predictions on a dataset using a model after running this code, you get the following error:

Traceback (most recent call last):
  File "/mnt/home/lotrecks/anaconda3/envs/dygiepp/bin/allennlp", line 5, in <module>
    from allennlp.__main__ import run
  File "/mnt/home/lotrecks/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/__init__.py", line 18, 
in <module>
    import spacy, torch, numpy  # noqa
  File "/mnt/home/lotrecks/.local/lib/python3.7/site-packages/spacy/__init__.py", line 12, in <module>
    from .cli.info import info as cli_info
  File "/mnt/home/lotrecks/.local/lib/python3.7/site-packages/spacy/cli/__init__.py", line 1, in <module>
    from .download import download  # noqa: F401
  File "/mnt/home/lotrecks/.local/lib/python3.7/site-packages/spacy/cli/download.py", line 5, in <module>
    import requests
  File "/mnt/home/lotrecks/.local/lib/python3.7/site-packages/requests/__init__.py", line 44, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'

This is something I also noticed when working directly with huggingface yesterday, that sometimes the actual problem is a package that has chardet as a dependency (here it's spacy) that isn't installed, but you get an error about chardet instead. Installing chardet doesn't solve the problem.

serenalotreck commented 1 year ago

If someone could try the following command and let me know how long it takes to solve/if it ever solves, that would be amazing!

conda create --name dygiepp -c conda-forge -c anaconda python=3.7
 allennlp allennlp-models pandas beautifulsoup4 lxml python-Levenshtein optuna

It's still solving for me; while I couldn't get allennlp to install with conda if I tried it after making the environment, it worked when I did it in one line while creating the environment. But when I went to install the other packages, they also never solved. I think that doing it this way with everything in one line should work, but it's been trying to solve for a while so I was curious to see if it worked for anyone else.

I have the libmabma installer as my default as per the instructions here.

EDIT: spelling

serenalotreck commented 1 year ago

I also opened this issue on conda about the error that's appearing when I use pip inside the conda environment.

serenalotreck commented 1 year ago

So I did end up getting a version of building and installing everything with conda in one go to run, but allennlp==1.1.0 isn't available on conda. Closing this because based on the response to the issue I opened at conda, I think the issue with pip installations in my conda environment is me-specific

dwadden commented 1 year ago

Sorry I missed this. If things don't work as-is, feel free to submit a PR with what you did and I'll merge.