Annif
Annif copied to clipboard
Python 3.12 support
Python 3.12 was released last October, so we should try to support it in Annif.
Currently support is not possible because of the following (to be continued...):
-
~gensim v4.3.2 does not provide a wheel for Python 3.12 in PyPI, and building the wheel locally fails:~
... gensim/models/word2vec_inner.c:25:10: fatal error: Python.h: No such file or directory 25 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
- ~issues https://github.com/piskvorky/gensim/issues/3511, https://github.com/piskvorky/gensim/issues/3510~
-
tensorflow-io-gcs-filesystem requires Python >=3.7, <3.12
- issues https://github.com/tensorflow/io/issues/1761, https://github.com/tensorflow/io/issues/1966)
-
stwfsapy requires Python <3.12,>=3.9
- issue https://github.com/zbw/stwfsapy/issues/61
gensim v4.3.2 does not provide a wheel for Python 3.12 in PyPI, and building > the wheel locally fails:
... gensim/models/word2vec_inner.c:25:10: fatal error: Python.h: No such file or directory 25 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
- issues https://github.com/piskvorky/gensim/issues/3511, https://github.com/piskvorky/gensim/issues/3510
Actually this was resolved by installing python3.12-dev
system package, which was missing from my laptop.
As gensim can be installed, provided that the python3.12-dev
system package is available, even currently it is possible to install Annif (or at least Poetry can resolve dependencies) if the unsupported dependencies are resctricted to Python <3.12, that is using this in pyproject.toml
:
tensorflow-cpu = { version = "2.15.*", optional = true, python = "<3.12" }
stwfsapy = { version = "0.4.*", optional = true, python = "<3.12" }
It looks like Ubuntu 24.04, to be released in April 2024, will come with Python 3.12. So it would be nice if we could support it soon. But of course, older Python versions can also be installed on Ubuntu.
tensorflow-cpu = { version = "2.15.*", optional = true, python = "<3.12" }
Also TensorFlow could be installed, if it could be upgraded to version 2.16.*, but this is blocked by https://github.com/tensorflow/tensorflow/issues/63585.
Not fully closed, because stwfsapy and NN ensemble do not work on Python 3.12.
Closed by #796.