ontime-re / ontime

Your library to work with time series
Apache License 2.0
4 stars 1 forks source link

Dependencies installation failing with Python 3.12 #50

Open ben-jy opened 2 months ago

ben-jy commented 2 months ago

While Python 3.12 is said supported ("python = ">=3.10,<3.13" in pyproject.toml file), dependencies installation fails when using this version. This failure seems to be caused by a Pytorch version, which depends on the triton libary version that can not be found. This issue does not occur with Python 3.10 and 3.11.

Steps to reproduce

  1. Install python 3.12 (or use a conda environment with python 3.12)
  2. Install poetry with pip install poetry
  3. Install dependencies with poetry install
  4. Installation fails with the following error logs :
  - Installing triton (2.1.0): Failed

  RuntimeError

  Unable to find installation candidates for triton (2.1.0)

  at ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/chooser.py:74 in choose_for
       70│
       71│             links.append(link)
       72│
       73│         if not links:
    →  74│             raise RuntimeError(f"Unable to find installation candidates for {package}")
       75│
       76│         # Get the best link
       77│         chosen = max(links, key=lambda link: self._sort_key(package, link))
       78│

Cannot install triton.

Expected behavior

The installation should complete without errors, setting up all dependencies required for the project.

Environment:

ben-jy commented 1 month ago

It's seems that there is also a problem with other libraries. When trying to add ontime as a dependency of a new project with python 3.12, I get a new error :

  - Downgrading numpy (1.26.0 -> 1.25.2): Failed

  ChefBuildError

  Backend 'setuptools.build_meta:__legacy__' is not available.

  Cannot import 'setuptools.build_meta'

  at ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with numpy (1.25.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "numpy (==1.25.2)"'.

This numpy version (1.25.2) is a depedency of skforecast, which is not support until python 3.11. Again, there is no issue with version 3.11, therefore we should set the maximum supported version of Python to 3.11.