Skip to content

Cannot run forecast on Python 3.12 (Dependency Deadlock with scikit-learn) #333

@astropedrocosta

Description

@astropedrocosta

Hello team,

I am attempting to set up the project on a fresh macOS environment with Python 3.12. I've encountered a dependency deadlock that prevents the model from running.

The Issue:

  • Python 3.12 requires scikit-learn >= 1.3 (older versions do not build).
  • The pre-trained gradient boosting model downloaded by gb_loader appears to have been pickled with an older scikit-learn version (<1.3).
  • When loading the model with scikit-learn >= 1.5, it throws: AttributeError: Can't get attribute '__pyx_unpickle_CyAbsoluteError' on <module 'sklearn._loss._loss' ...>

Steps to Reproduce:

  • Clone repo on macOS (Python 3.12).
  • Manually patch pyproject.toml to allow newer libraries (since numpy and scikit-learn requirements are too old for Py3.12).
  • Run a basic forecast.

We likely need to re-pickle the gradient boosting models using a newer version of scikit-learn, or provide a separate model file for Python 3.12+ users.

I am happy to work on any potential fixes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions