lmcinnes / umap

Uniform Manifold Approximation and Projection
BSD 3-Clause "New" or "Revised" License
7.24k stars 787 forks source link

can't install umap-learn in python 3.10.2 #900

Open vmgustavo opened 1 year ago

vmgustavo commented 1 year ago

When I add umap-learn using Poetry it finds the requirements versions as:

• Installing llvmlite (0.34.0)
• Installing numba (0.51.2)

But fails to install numba as the first version of Numba that supports Python 3.10 is 0.55.0 (Numba 0.55.0 Release Notes)

This is the error message I get:

  ERROR: Command errored out with exit status 1: .venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-ooas2vcd/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-ooas2vcd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-6xue7xjo/install-record.txt --single-version-externally-managed --compile --install-headers .venv/include/site/python3.10/numba Check the logs for full command output.
lmcinnes commented 1 year ago

It should work with numba 0.55; 0.51.2 is a minimum numba version. Perhaps this is to do with poetry?

vmgustavo commented 1 year ago

It is indeed a problem with dependencies versions that poetry is trying to fix but failing. I am getting this log when it tries to install numba:

   1: fact: numba (0.56.0) depends on llvmlite (>=0.39.0dev0,<0.40)
   1: fact: numba (0.56.0) depends on numpy (>=1.18,<1.23)
   1: fact: numba (0.56.0) depends on importlib-metadata (*)
   1: derived: not numba (==0.56.0)
   1: fact: numba (0.55.2) depends on llvmlite (>=0.38.0rc1,<0.39)
   1: fact: numba (0.55.2) depends on numpy (>=1.18,<1.23)
   1: derived: not numba (==0.55.2)
   1: fact: numba (0.55.1) depends on llvmlite (>=0.38.0rc1,<0.39)
   1: fact: numba (0.55.1) depends on numpy (>=1.18,<1.22)
   1: derived: not numba (==0.55.1)
   1: fact: numba (0.55.0) depends on llvmlite (>=0.38.0rc1,<0.39)
   1: fact: numba (0.55.0) depends on numpy (>=1.18,<1.22)
   1: derived: not numba (==0.55.0)
   1: fact: numba (0.54.1) requires Python >=3.7,<3.10
   1: derived: not numba (==0.54.1)
   1: fact: numba (0.54.0) requires Python >=3.7,<3.10
   1: derived: not numba (==0.54.0)
   1: fact: numba (0.53.1) requires Python >=3.6,<3.10
   1: derived: not numba (==0.53.1)
   1: fact: numba (0.53.0) requires Python >=3.6,<3.10
   1: derived: not numba (==0.53.0)
   1: fact: numba (0.52.0) requires Python >=3.6,<3.9
   1: derived: not numba (==0.52.0)
   1: fact: numba (0.51.2) depends on llvmlite (>=0.34.0.dev0,<0.35)
   1: fact: numba (0.51.2) depends on numpy (>=1.15)
   1: selecting numba (0.51.2)
jzazo commented 1 year ago

I added the following dependency in my pyproject.toml, and this helped poetry lock properly:

llvmlite = ">=0.39.0dev0,<0.40"

My guess is that numba should add that requirement explicitly when using python 3.10 (not sure if the requirement exists or not, though). Any longer term solucion?

masylum commented 10 months ago

I solved it by installing the last version of numba (0.57) (poetry add numba) since it has support for python 3.10+