8000 [Regression/Backward compatibility] ImportError: cannot import name 'MaskedArray' when building with scikit-learn release 0.23.0 · Issue #17213 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[Regression/Backward compatibility] ImportError: cannot import name 'MaskedArray' when building with scikit-learn release 0.23.0 #17213

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

Closed
neomatrix369 opened this issue May 13, 2020 · 2 comments

Comments

@neomatrix369
Copy link
neomatrix369 commented May 13, 2020

Describe the bug

Running existing packages/programs with the latest release of 0.23.0 gives an import error on MaskedArray.

Bounding the requirements to < 0.23.0 resolves this issue, but then it reverts to the older version although would be good to be on the latest release.

Steps/Code to Reproduce

Setup

$ pip install scikit-learn>=0.20.2

or 

$ pip install scikit-learn==0.23.0

Code

from sklearn.utils.fixes import MaskedArray
....
<rest of your code>

Expected Results

No exception or a warning with an alternative solution to the above issue. A depreciation message if the class has been removed.

Although, from https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/utils/fixes.py#L20 it appears that this is due to be removed in 0.25.0.

Actual Results

ImportError while importing test module '/opt/atlassian/pipelines/agent/build/tests_package_name/module.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_package_name.py:7: in <module>
    from package_name import H2OGradientBoostingModel
package_name/module.py:5: in <module>
    from skopt import gp_minimize
/usr/local/lib/python3.6/site-packages/skopt/__init__.py:54: in <module>
    from .searchcv import BayesSearchCV
/usr/local/lib/python3.6/site-packages/skopt/searchcv.py:16: in <module>
    from sklearn.utils.fixes import MaskedArray
E   ImportError: cannot import name 'MaskedArray'

Versions

0.23.0

@neomatrix369 neomatrix369 changed the title [Error] ImportError: cannot import name 'MaskedArray' when building with scikit-learn release 0.23.0 [Regression/Backward compatibility] ImportError: cannot import name 'MaskedArray' when building with scikit-learn release 0.23.0 May 13, 2020
@cmarmo
Copy link
Contributor
cmarmo commented May 13, 2020

Hi @neomatrix369, thanks for reaching out. Closing as duplicate of #17198. Fixed by @NicolasHug in #17199

@cmarmo cmarmo closed this as completed May 13, 2020
@rth
Copy link
Member
rth commented May 13, 2020

Also see temporary workaround in scikit-optimize/scikit-optimize#902 (comment)

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

No branches or pull requests

3 participants
0