centre-for-humanities-computing / DaCy

DaCy: The State of the Art Danish NLP pipeline using SpaCy
https://centre-for-humanities-computing.github.io/DaCy/
Apache License 2.0
91 stars 20 forks source link

ContextualVersionConflict Traceback (most recent call last) #141

Closed KennethEnevoldsen closed 1 year ago

KennethEnevoldsen commented 1 year ago

Moved from #133, originally posted by @EaLindhardt

I've tried to download dacy through anaconda, both with pip and conda install and the different ways of installing: https://centre-for-humanities-computing.github.io/DaCy/installation.html

when running

import dacy

i get the following

`--------------------------------------------------------------------------- ContextualVersionConflict Traceback (most recent call last) Input In [14], in <cell line: 1>() ----> 1 import dacy

File ~\AppData\Roaming\Python\Python39\site-packages\dacyinit.py:4, in 1 from dacy.hate_speech import make_offensive_transformer # noqa 2 from dacy.sentiment import make_emotion_transformer # noqa ----> 4 from .about import download_url, title, version # noqa 5 from .download import download_model # noqa 6 from .load import load, models, where_is_my_dacy

File ~\AppData\Roaming\Python\Python39\site-packages\dacy\about.py:3, in 1 import pkg_resources ----> 3 version = pkg_resources.get_distribution("dacy").version 4 title = "dacy" 5 download_url = "https://github.com/centre-for-humanities-computing/DaCy"

File ~\Anaconda3\lib\site-packages\pkg_resourcesinit.py:477, in get_distribution(dist) 475 dist = Requirement.parse(dist) 476 if isinstance(dist, Requirement): --> 477 dist = get_provider(dist) 478 if not isinstance(dist, Distribution): 479 raise TypeError("Expected string, Requirement, or Distribution", dist)

File ~\Anaconda3\lib\site-packages\pkg_resourcesinit.py:353, in get_provider(moduleOrReq) 351 """Return an IResourceProvider for the named module or requirement""" 352 if isinstance(moduleOrReq, Requirement): --> 353 return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] 354 try: 355 module = sys.modules[moduleOrReq]

File ~\Anaconda3\lib\site-packages\pkg_resourcesinit.py:897, in WorkingSet.require(self, requirements) 888 def require(self, requirements): 889 """Ensure that distributions matching requirements are activated 890 891 requirements must be a string or a (possibly-nested) sequence (...) 895 included, even if they were already activated in this working set. 896 """ --> 897 needed = self.resolve(parse_requirements(requirements)) 899 for dist in needed: 900 self.add(dist)

File ~\Anaconda3\lib\site-packages\pkg_resourcesinit.py:788, in WorkingSet.resolve(self, requirements, env, installer, replace_conflicting, extras) 785 if dist not in req: 786 # Oops, the "best" so far conflicts with a dependency 787 dependent_req = required_by[req] --> 788 raise VersionConflict(dist, req).with_context(dependent_req) 790 # push the new requirements onto the stack 791 new_requirements = dist.requires(req.extras)[::-1]

ContextualVersionConflict: (spacy 3.3.1 (c:\users\au576018\anaconda3\lib\site-packages), Requirement.parse('spacy<3.3.0,>=3.2.0'), {'dacy'})`

How do I solve this?

@EaLindhardt will you please add the following information:

you can also type python -m spacy info --markdown and copy-paste the result here along with the DaCy version, which you can get using python -c "import dacy; print(dacy.__version__)"

EaLindhardt commented 1 year ago

Information about SpaCy:

## Info about spaCy

- **spaCy version:** 3.2.4
- **Platform:** Windows-10-10.0.19044-SP0
- **Python version:** 3.9.12
- **Pipelines:** da_core_news_lg (3.3.0), da_core_news_md (3.3.0), da_core_news_sm (3.3.0), en_core_web_lg (3.3.0), en_core_web_md (3.3.0), en_core_web_sm (3.3.0)

My version of DaCy: 2.0.1.

I work in Jupyter Notebook and have Windows 10.

EaLindhardt commented 1 year ago

For some reason, it works now. With several warnings, though

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.