Skip to content

[Bug] Fresh installation fails due to deprecated 'sklearn' dependency (missing in requirements.txt) #1264

@kush124k

Description

@kush124k

Describe the bug
On a brand new environment (or device) where scikit-learn has never been installed, running the installation for the python-operator-dataflow example fails.

This happens because a transitive dependency (likely thop building from source) requests sklearn (deprecated). Since no pre-built wheels exist in the local cache, pip attempts to build the package from source and crashes when it encounters the deprecated sklearn package name.

To Reproduce
Steps to reproduce the behavior on a clean machine:

  1. Uninstall scikit-learn and clear pip cache (to simulate a new user):
    pip uninstall scikit-learn -y && pip cache purge
  2. Navigate to examples/python-operator-dataflow.
  3. Run pip install -r requirements.txt.
  4. See error: The 'sklearn' PyPI package is deprecated, use 'scikit-learn'.

Expected behavior
The installation should handle the deprecated dependency automatically by resolving to scikit-learn.

Screenshots

Image

Environment

  • OS: Windows 10
  • Python Version: 3.12
  • Install Type: Fresh Install / No Cache

Proposed Fix
Explicitly adding scikit-learn to requirements.txt ensures pip resolves the correct package before the transitive dependency triggers the build failure.

Deep Dive / Root Cause

To verify why the build was failing...

Deep Dive / Root Cause
To verify why the build was failing, I attempted to force-install thop from source using pip install --no-binary :all: thop.

This revealed a secondary underlying issue: thop version 0.0.30_2512161416 violates PEP 440 versioning standards (due to the underscore), causing an immediate crash when building from source on modern Python versions (3.12+).

Screenshot of Source Build Failure:

Image Image

This confirms that falling back to a source build is not a viable option, making the scikit-learn fix critical for new users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions