Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] sklearn is a hard dependency after #5630 #5662

Closed
bdice opened this issue Nov 17, 2023 · 1 comment · Fixed by #5663
Closed

[BUG] sklearn is a hard dependency after #5630 #5662

bdice opened this issue Nov 17, 2023 · 1 comment · Fixed by #5663
Labels
bug Something isn't working

Comments

@bdice
Copy link
Contributor

bdice commented Nov 17, 2023

Describe the bug
@jarmak-nv reported this issue when importing cuml:

(cuml-pip-test-11-17) (base) picard@Enterprise-G:~/cuml-pip-test-11-17$ python -c "import cuml"
Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "/home/picard/cuml-pip-test-11-17/lib/python3.10/site-packages/cuml/__init__.py", line 17, in <module>
   from cuml.internals.base import Base, UniversalBase
 File "base.pyx", line 31, in init cuml.internals.base
ModuleNotFoundError: No module named 'sklearn'

Installing sklearn fixes this error, indicating that sklearn is a hard dependency. This is due to changes in #5630. cc: @betatim

Steps/Code to reproduce bug

pip install \
    --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
    "cuml-cu12>=23.12.0a0,<=23.12" "dask-cuda>=23.12.0a0,<=23.12"

Expected behavior
cuml should import without installing sklearn.

@bdice bdice added bug Something isn't working ? - Needs Triage Need team to review and classify and removed ? - Needs Triage Need team to review and classify labels Nov 17, 2023
@bdice
Copy link
Contributor Author

bdice commented Nov 17, 2023

Maybe the _repr_mimebundle_ method in #5630 needs to be conditionally defined, with a try/except ImportError for sklearn?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant