Closed mikepqr closed 8 years ago
the exceptions
module isn't in 0.17.1 Notice that the URL of the docs you link to have "dev" in them, indicating that theyre for version 0.18.dev0
. You have version 0.17.1
, so you should install scikit-learn from the master
branch of this repo (e.g. with pip or with setup,py )and it should work.
Ah, of course!
Is there any way to access the exceptions defined by sklearn without upgrading to unstable code?
I suppose some of the base exceptions are in utils.validation.py while the others are inheriting them like NeighborsWarning. They probably should be accessible. Cheers.
@williamsmj Also, I wouldn't say that just because it's in the 'dev' version, it is "unstable" or anything. The code pushed to master passes the same test suite that 0.17.1 does, it's just that there's been no release since the code was added.
Understood, but I'm in an environment where I need to deploy tagged releases rather than track master.
Description
No module named 'sklearn.exceptions'
Steps/Code to Reproduce
Tried on both Linux and OS X, and with both virtualenv and anaconda:
pip install scikit-learn
(orpip install --no-use-wheel scikit-learn
, orconda install scikit-learn
), thenfrom sklearn.exceptions import NotFittedError
Expected Results
sklearn.exceptions
is imported, per e.g. http://scikit-learn.org/dev/modules/generated/sklearn.exceptions.NotFittedError.htmlActual Results
Note that
sklearn.__file__
points to a directory containing a scikit-learn installation that, as far as I can tell, works in all other ways. Butexceptions.py
is missing:Versions
Have tried this on several platforms (including python 2.7 and python 3.5), but here's an example: