Scikit-learn: AttributeError: module 'sklearn' has no attribute 'datasets'

Created on 29 Apr 2016  ·  3Comments  ·  Source: scikit-learn/scikit-learn

I installed it by pip install sklearn. And this directory exist in site-packages dir
localhost.root.#pts/0 /usr/lib64/python3.5/site-packages/sklearn: ls -l
total 704
drwxr-xr-x 3 root root 4096 Apr 23 03:12 check_build
-rw-r--r-- 1 root root 3036 Apr 23 03:12 __init
.py
drwxr-xr-x 2 root root 4096 Apr 23 03:12 pycache
-rw-r--r-- 1 root root 895 Apr 23 03:12 _build_utils.py
-rwxr-xr-x 1 root root 221824 Apr 23 03:12 _isotonic.cpython-35m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root 17700 Apr 23 03:12 base.py
-rw-r--r-- 1 root root 19343 Apr 23 03:12 calibration.py
drwxr-xr-x 4 root root 4096 Apr 23 03:12 cluster
drwxr-xr-x 4 root root 4096 Apr 23 03:12 covariance
drwxr-xr-x 3 root root 4096 Apr 23 03:12 cross_decomposition
-rw-r--r-- 1 root root 67644 Apr 23 03:12 cross_validation.py
drwxr-xr-x 7 root root 4096 Apr 23 03:12 datasets
drwxr-xr-x 4 root root 4096 Apr 23 03:12 decomposition
-rw-r--r-- 1 root root 28413 Apr 23 03:12 discriminant_analysis.py
-rw-r--r-- 1 root root 17508 Apr 23 03:12 dummy.py
drwxr-xr-x 4 root root 4096 Apr 23 03:12 ensemble
drwxr-xr-x 4 root root 4096 Apr 23 03:12 externals
drwxr-xr-x 4 root root 4096 Apr 23 03:12 feature_extraction
drwxr-xr-x 4 root root 4096 Apr 23 03:12 feature_selection
drwxr-xr-x 4 root root 4096 Apr 23 03:12 gaussian_process
-rw-r--r-- 1 root root 38160 Apr 23 03:12 grid_search.py
-rw-r--r-- 1 root root 12307 Apr 23 03:12 isotonic.py
-rw-r--r-- 1 root root 17973 Apr 23 03:12 kernel_approximation.py
-rw-r--r-- 1 root root 6556 Apr 23 03:12 kernel_ridge.py
-rw-r--r-- 1 root root 268 Apr 23 03:12 lda.py
-rw-r--r-- 1 root root 14403 Apr 23 03:12 learning_curve.py
drwxr-xr-x 4 root root 4096 Apr 23 03:12 linear_model
drwxr-xr-x 3 root root 4096 Apr 23 03:12 manifold
drwxr-xr-x 5 root root 4096 Apr 23 03:12 metrics
drwxr-xr-x 4 root root 4096 Apr 23 03:12 mixture
-rw-r--r-- 1 root root 28795 Apr 23 03:12 multiclass.py
-rw-r--r-- 1 root root 28917 Apr 23 03:12 naive_bayes.py
drwxr-xr-x 3 root root 4096 Apr 23 03:12 neighbors
drwxr-xr-x 3 root root 4096 Apr 23 03:12 neural_network
-rw-r--r-- 1 root root 21271 Apr 23 03:12 pipeline.py
drwxr-xr-x 3 root root 4096 Apr 23 03:12 preprocessing
-rw-r--r-- 1 root root 275 Apr 23 03:12 qda.py
-rw-r--r-- 1 root root 22098 Apr 23 03:12 random_projection.py
drwxr-xr-x 3 root root 4096 Apr 23 03:12 semi_supervised
-rw-r--r-- 1 root root 2856 Apr 23 03:12 setup.py
drwxr-xr-x 4 root root 4096 Apr 23 03:12 svm
drwxr-xr-x 3 root root 4096 Apr 23 03:12 tests
drwxr-xr-x 4 root root 4096 Apr 23 03:12 tree
drwxr-xr-x 5 root root 4096 Apr 23 03:12 utils

Most helpful comment

I got it
import sklearn.datasets

All 3 comments

I got it
import sklearn.datasets

Hey guys
I have this issue: AttributeError: module 'sklearn.tree' has no attribute 'all_clades'

I have updated sklearn , scipy and numpy. I am using
from sklearn import *
Any advice is appreciated.

Thanks in advance

all_clades??! are we talking about the same sklearn.tree?

Was this page helpful?
0 / 5 - 0 ratings