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

Import error with latest sklearn version #46

Closed
teneon opened this issue Dec 16, 2022 · 3 comments · Fixed by #47
Closed

Import error with latest sklearn version #46

teneon opened this issue Dec 16, 2022 · 3 comments · Fixed by #47
Assignees

Comments

@teneon
Copy link

teneon commented Dec 16, 2022

Hi guys, this issue occured after the upgrade to 1.1.3

ImportError: cannot import name '_pprint' from 'sklearn.base'

/.venv/lib/python3.10/site-packages/tscv/_split.py:19 in      │
│ <module>                                                                                         │
│                                                                                                  │
│    16 import numpy as np                                                                         │
│    17 from sklearn.utils import indexable                                                        │
│    18 from sklearn.utils.validation import _num_samples, check_consistent_length                 │
│ ❱  19 from sklearn.base import _pprint                                                           │
│    20 from sklearn.utils import _safe_indexing                                                   │
│    21                                                                                            │
│    22                                       

Could you please fix it ?

Kind regards,
Jim

@teneon
Copy link
Author

teneon commented Dec 16, 2022

It seems like sklearn moved _pprint to a different place in latest 1.3 version:

to be removed: from sklearn.base import _pprint (doesn't exist anymore)
to be added: from sklearn.utils import _pprint (seems to be the new location?)

Best regards,
Jim

@WenjieZ
Copy link
Owner

WenjieZ commented Jan 23, 2023

Hi, @teneon, thank you for bringing this to my attention.

The function _pprint desired has been moved to sklearn.model_selection. The solution would be either I import from there or I write my version of _pprint.

@WenjieZ
Copy link
Owner

WenjieZ commented Jan 23, 2023

I have released the latest version v0.1.3 on PyPI. Have a try and let me know whether this solves your problem @teneon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants