Hi Christoph,
Was this in a fresh virtual environment, or did you start with an older
install of Annif? Like Juho said, I think it could be that you have
previously installed spaCy language models that require a specific
version of spaCy.
I tried first installing Annif 1.2 with spaCy and the en_core_web_sm
language model (this was using python 3.10):
python3 -m venv venv
. venv/bin/activate
pip install -U pip wheel
pip install annif[spacy]==1.2.*
python -m spacy download en_core_web_sm
Now, "pip list" shows lots of packages including en_core_web_sm, which
is the spaCy English language model I just installed.
Then I tried upgrading to Annif 1.3:
pip install -U annif
and finally adding spaCy support:
pip install annif[spacy]
This didn't downgrade Annif to 1.2 as it did for you, but it produced an
error instead:
ERROR: pip's dependency resolver does not currently take into account
all the packages that are installed. This behaviour is the source of the
following dependency conflicts.
en-core-web-sm 3.7.1 requires spacy<3.8.0,>=3.7.2, but you have spacy
3.8.4 which is incompatible.
So it's not exactly the same situation as yours, but maybe similar. I
recommend that you check what "pip list" says and if you have any older
spaCy language models installed. You should upgrade those so that they
match the spaCy version (Annif 1.3 uses spaCy 3.8).
-Osma
On 10/02/2025 17:04, Christoph Poley wrote:
> Hi Juho,
> I've tried to install Annif with python3.9. Maybe, you can reproduce
> this problem.
> A quick and dirty fix from my point of view was: pip install --upgrade
> --force-reinstall annif ... and it works.
>
> Christoph
>
>
juho.i...@helsinki.fi schrieb am Montag, 10. Februar 2025 um 14:05:28 UTC+1:
>
> Hi Christoph!
>
> This did not reproduce the issue on my machine:
>
> 1. python3.12 -m venv annif-venv && source annif-venv/bin/activate
> 2. pip install --upgrade pip setuptools wheel
> 3. pip install annif # installs Annif 1.3
> 4. pip install annif[spacy] # retains Annif 1.3
>
> What happens if you try to install Annif with version 1.3 with Spacy
> in one operation: pip install annif[spacy]==1.3 ?
>
> Just a guess, but maybe the issue is due to a Spacy model on your
> machine; you could try redownloading(or removing and downloading it
> <
https://github.com/NatLibFi/Annif/blob/main/README.md>) I
> --
> You received this message because you are subscribed to the Google
> Groups "Annif Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
annif-users...@googlegroups.com
> <mailto:
annif-users...@googlegroups.com>.
> To view this discussion visit
>
https://groups.google.com/d/msgid/annif-users/6dcd74bc-34c8-4390-ab85-9015d6d76390n%40googlegroups.com <
https://groups.google.com/d/msgid/annif-users/6dcd74bc-34c8-4390-ab85-9015d6d76390n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 15 (Unioninkatu 36)
00014 HELSINGIN YLIOPISTO
Tel.
+358 50 3199529
osma.s...@helsinki.fi
http://www.nationallibrary.fi