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

Cannot Install #69

Open
AlexSch518 opened this issue Jul 11, 2023 · 8 comments
Open

Cannot Install #69

AlexSch518 opened this issue Jul 11, 2023 · 8 comments

Comments

@AlexSch518
Copy link

PIP install fails. There is an issue in setup.py where it is trying to install sklearn instead of scikit-learn.

@JHoelli
Copy link

JHoelli commented Jul 19, 2023

Hi,
I am not the author of the package, but I just had the same issue.

Sklearn is already replaced wit scikit-learn in the setup.py, only a new pypi release is missing. Therefore, pip install https://github.com/gkhayes/mlrose/archive/refs/heads/master.zip (with python 3.9. and pip 23.1.2) worked. Hope this helps.
Another workaround, that usually works for me (however I would not recommend to use it) is preinstalling "the old" sklearn pip install sklearn==0.0

@lesteve
Copy link

lesteve commented Jun 4, 2024

Hi, scikit-learn developer here 👋.

@gkhayes is there any chance you could make a new PyPI release with the sklearn -> scikit-learn fix from #65. Of course I completely understand if you have plenty of other things to do that are higher priority for you.

We recently got two issues in scikit-learn about people trying to install mlrose and who got an error because of the dependency on the deprecated sklearn PyPI package. There are definitely some work-arounds but I am guessing a portion of users are unsure how to use them.

@gkhayes
Copy link
Owner

gkhayes commented Jun 4, 2024 via email

@lesteve
Copy link

lesteve commented Jun 5, 2024

Thanks, there is no rush, but indeed that would be great if you manage to find the time to do this 🙏

@leoauri
Copy link

leoauri commented Jan 3, 2025

Installing with pip install https://github.com/gkhayes/mlrose/archive/refs/heads/master.zip currently results in the following error, at least in a Google Colab environment:

---------------------------------------------------------------------------

ImportError                               Traceback (most recent call last)

[<ipython-input-18-b2f1840887b1>](https://localhost:8080/#) in <cell line: 1>()
----> 1 import mlrose
...

1 frames

[/usr/local/lib/python3.10/dist-packages/mlrose/__init__.py](https://localhost:8080/#) in <module>
     10                       Knapsack, TravellingSales, Queens, MaxKColor,
     11                       CustomFitness)
---> 12 from .neural import NeuralNetwork, LinearRegression, LogisticRegression
     13 from .opt_probs import DiscreteOpt, ContinuousOpt, TSPOpt

[/usr/local/lib/python3.10/dist-packages/mlrose/neural.py](https://localhost:8080/#) in <module>
     10 from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
     11 from sklearn.metrics import mean_squared_error, log_loss
---> 12 from sklearn.externals import six
     13 from .activation import identity, relu, sigmoid, softmax, tanh
     14 from .algorithms import random_hill_climb, simulated_annealing, genetic_alg

ImportError: cannot import name 'six' from 'sklearn.externals' (/usr/local/lib/python3.10/dist-packages/sklearn/externals/__init__.py)


---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

@lesteve
Copy link

lesteve commented Jan 3, 2025

@leoauri this is a separate issue see #59 that should be fixed by #64 or #67 for example. I guess a better fix would be to remove the need of six which is for Python2/3 compatibility and use the Python 3 construct.

More context: sklearn.externals.six has been removed some time ago (in scikit-learn 0.23 I think released in May 2020) and mlrose has not been updated, which is completely understandable because you know mlrose maintainers likely have plenty of higher priority things to do (full disclosure I am a scikit-learn maintainer, not a mlrose maintainer) ...

@leoauri
Copy link

leoauri commented Jan 3, 2025

@lesteve Thanks for clarifying!

@leoauri
Copy link

leoauri commented Jan 3, 2025

For others looking to have this working until some pull request has been merged, pip install git+https://github.com/Gabriel-p/mlrose@master seems to have both these issues resolved.

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