nlmatics / nlm-ingestor

This repo provides the server side code for llmsherpa API to connect. It includes parsers for various file formats.
https://www.nlmatics.com
Apache License 2.0
1.05k stars 152 forks source link

Dependency versions too strict #46

Closed choyuansu closed 2 months ago

choyuansu commented 5 months ago

I think the version requirements in setup.py is a little too strict. For the following packages, only one version is allowed. This causes issues when I was installing nlm-ingestor from a requirements.txt.

install_requires=[
    ...
    "symspellpy==6.7.0",
    "pandas==1.2.4",
    "mistune==2.0.3",
    "lxml==4.9.1",
    ...
]

Error message from pip install -r requirements.txt:

ERROR: Cannot install -r requirements.txt (line 107), -r requirements.txt (line 129), -r requirements.txt (line 25), -r requirements.txt (line 5) and pandas==2.0.3 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested pandas==2.0.3
    altair 5.2.0 depends on pandas>=0.25
    gradio 3.36.1 depends on pandas
    layoutparser 0.3.4 depends on pandas
    nlm-ingestor 0.1.5 depends on pandas==1.2.4
    The user requested pandas==2.0.3
    altair 5.2.0 depends on pandas>=0.25
    gradio 3.36.1 depends on pandas
    layoutparser 0.3.4 depends on pandas
    nlm-ingestor 0.1.4 depends on pandas==1.2.4
    The user requested pandas==2.0.3
    altair 5.2.0 depends on pandas>=0.25
    gradio 3.36.1 depends on pandas
    layoutparser 0.3.4 depends on pandas
    nlm-ingestor 0.1.3 depends on pandas==1.2.4
    The user requested pandas==2.0.3
    altair 5.2.0 depends on pandas>=0.25
    gradio 3.36.1 depends on pandas
    layoutparser 0.3.4 depends on pandas
    nlm-ingestor 0.1.2 depends on pandas==1.2.4
    The user requested pandas==2.0.3
    altair 5.2.0 depends on pandas>=0.25
    gradio 3.36.1 depends on pandas
    layoutparser 0.3.4 depends on pandas
    nlm-ingestor 0.1.1 depends on pandas==1.2.4

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Is it possible to use a range of versions for these packages, e.g. symspellpy>=6.7.0, pandas>=1.2.4?

Thanks.