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

sklearn.externals.six is Deprecated in Sklearn 0.23 #41

Open
TomLaMantia opened this issue Jul 6, 2020 · 8 comments
Open

sklearn.externals.six is Deprecated in Sklearn 0.23 #41

TomLaMantia opened this issue Jul 6, 2020 · 8 comments

Comments

@TomLaMantia
Copy link

Since sklearn.externals.six is deprecated as of version 0.23 (https://github.com/scikit-learn/scikit-learn/pull/12916/files), a fresh install of skopes with the latest version of sklearn will yield the following error:

ImportError: cannot import name 'six'

when running from skrules import SkopeRules, on line 12 of skope_rules.py.

Would it make sense to rely on the official version of six as the documentation suggests? If this is something the community is interested in, I'd be happy to open a PR.

The usage of six seems to be extremely minimal in this project, so the PR seems straightforward, assuming that I am not overlooking any complexities?

@arplas arplas mentioned this issue Aug 13, 2020
@csinva
Copy link

csinva commented Aug 24, 2020

Agreed this is a simple fix that should be implemented!

I made a quick fix at this repo in the meantime. It's runnable with pip install git+https://github.com/csinva/interpretability-implementations-demos and then from imodels import SkopeRules.

@ngoix
Copy link
Member

ngoix commented Aug 30, 2020

thanks for reporting, don't hesitate to open a PR fixing this

@TomLaMantia
Copy link
Author

@ngoix I believe I do not have write permissions to create a new branch for this.

@ngoix
Copy link
Member

ngoix commented Sep 1, 2020

you need to clone this repo and create your branch on your clone - same as described in scikit-learn how to contribute

@TomLaMantia
Copy link
Author

@ngoix thanks! PR is open now: #46

@LuisBlanche
Copy link

Hi,
this bug is still happening in the last version available in PyPi (1.0.1)
It's not happening when installing from github though

@TomLaMantia
Copy link
Author

I'd be happy to assist with a PiPy deployment if that would be helpful to the project?

@DaBeIDS
Copy link

DaBeIDS commented Aug 11, 2022

Hi,
we also had the same issue now.
A way arround can be found here:
https://stackoverflow.com/questions/61867945/python-import-error-cannot-import-name-six-from-sklearn-externals

Before importing something you can do:
import six
import sys
sys.modules['sklearn.externals.six'] = six

A solution proposed in there for developer of sklearn seems to be
Replace "from sklearn.externals import six" by "import six"

Is somebody going to fix that at some point because it is really confusing to download a package and it initially does not work.

Best regards,
David

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

5 participants