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

ImportError: cannot import name 'six' from 'sklearn.externals' #59

Open
NolanC33 opened this issue Mar 1, 2022 · 1 comment · May be fixed by #64
Open

ImportError: cannot import name 'six' from 'sklearn.externals' #59

NolanC33 opened this issue Mar 1, 2022 · 1 comment · May be fixed by #64

Comments

@NolanC33
Copy link

NolanC33 commented Mar 1, 2022

When trying to follow along https://github.com/gkhayes/mlrose/blob/master/tutorial_examples.ipynb ,

I get the following:

(base) nolan@nolanDesktop:.../optimization$ python3 ./thing.py
Traceback (most recent call last):
  File "./thing.py", line 1, in <module>
    import mlrose
  File "/home/nolan/anaconda3/lib/python3.8/site-packages/mlrose/__init__.py", line 12, in <module>
    from .neural import NeuralNetwork, LinearRegression, LogisticRegression
  File "/home/nolan/anaconda3/lib/python3.8/site-packages/mlrose/neural.py", line 12, in <module>
    from sklearn.externals import six
ImportError: cannot import name 'six' from 'sklearn.externals' (/home/nolan/anaconda3/lib/python3.8/site-packages/sklearn/externals/__init__.py)

which is resolved by https://stackoverflow.com/questions/61867945/python-import-error-cannot-import-name-six-from-sklearn-externals

(this appears related to #54)

Could the library be updated such that the workaround is no longer needed?

(base) nolan@nolanDesktop:.../optimization$ pip3 show mlrose
Name: mlrose
Version: 1.3.0
Summary: MLROSe: Machine Learning, Randomized Optimization and Search
Home-page: https://github.com/gkhayes/mlrose
Author: Genevieve Hayes
Author-email: None
License: BSD
Location: /home/nolan/anaconda3/lib/python3.8/site-packages
Requires: numpy, scipy, sklearn
Required-by:
@ialxn
Copy link

ialxn commented Mar 18, 2022

Recent versions of sklear-externals do not provide six anymore. Import it as standalone package.
I'v added a patch that should fix things.

0001-BUGFIX-sklearn-does-not-provide-six-anymore.-Import-.txt

@pcjedi pcjedi linked a pull request Jul 10, 2022 that will close this issue
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