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:
- Uninstall
scikit-learn and clear pip cache (to simulate a new user):
pip uninstall scikit-learn -y && pip cache purge
- Navigate to
examples/python-operator-dataflow.
- Run
pip install -r requirements.txt.
- 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
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:
This confirms that falling back to a source build is not a viable option, making the scikit-learn fix critical for new users.
Describe the bug
On a brand new environment (or device) where
scikit-learnhas never been installed, running the installation for the python-operator-dataflow example fails.This happens because a transitive dependency (likely
thopbuilding from source) requestssklearn(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 deprecatedsklearnpackage name.To Reproduce
Steps to reproduce the behavior on a clean machine:
scikit-learnand clear pip cache (to simulate a new user):pip uninstall scikit-learn -y && pip cache purgeexamples/python-operator-dataflow.pip install -r requirements.txt.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
Environment
Proposed Fix
Explicitly adding
scikit-learntorequirements.txtensures 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
thopfrom source usingpip install --no-binary :all: thop.This revealed a secondary underlying issue:
thopversion0.0.30_2512161416violates 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:
This confirms that falling back to a source build is not a viable option, making the
scikit-learnfix critical for new users.