[Python] Version unsupported imbalanced-learn

Discussão em 'Python' iniciado por Stack, Agosto 9, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to install scikit-learn and imbalanced-learn for ML project using poetry.

    # File pyproject.toml

    [project]
    name = "hello"
    version = "0.1.0"
    description = ""
    authors = [
    {name = "",email = ""}
    ]
    readme = "README.md"
    requires-python = ">=3.13"
    dependencies = [
    ]


    python (version 3.13.6)

    Poetry (version 2.1.4)

    But, Getting error as below:

    ubuntu@ubuntu:~/hello$ poetry add scikit-learn imbalanced-learn
    Creating virtualenv hello in /home/ubuntu/hello/.venv
    Using version ^1.7.1 for scikit-learn
    Using version ^0.13.0 for imbalanced-learn

    Updating dependencies
    Resolving dependencies... (0.4s)

    Because no versions of sklearn-compat match >0.1,<0.1.1 || >0.1.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<1
    and sklearn-compat (0.1.0) depends on scikit-learn (>1.2,<1.7), sklearn-compat (>=0.1,<0.1.1 || >0.1.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<1) requires scikit-learn (>1.2,<1.7).
    And because sklearn-compat (0.1.1) depends on scikit-learn (>=1.2,<1.7), sklearn-compat (>=0.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<1) requires scikit-learn (>=1.2,<1.7).
    And because sklearn-compat (0.1.2) depends on scikit-learn (>=1.2,<1.7)
    and sklearn-compat (0.1.3) depends on scikit-learn (>=1.2,<1.7), sklearn-compat (>=0.1,<1) requires scikit-learn (>=1.2,<1.7).
    Because no versions of imbalanced-learn match >0.13.0,<0.14.0
    and imbalanced-learn (0.13.0) depends on sklearn-compat (>=0.1,<1), imbalanced-learn (>=0.13.0,<0.14.0) requires sklearn-compat (>=0.1,<1).
    Thus, imbalanced-learn (>=0.13.0,<0.14.0) requires scikit-learn (>=1.2,<1.7).
    So, because hello depends on both scikit-learn (^1.7.1) and imbalanced-learn (^0.13.0), version solving failed.
    ubuntu@ubuntu:~/hello$


    please help.

    Continue reading...

Compartilhe esta Página