Python 3 ImportError: Unable to import the name "model select" OS X 10.11.3, Anconda
Python 3.5.1 | Anaconda 4.0.0 (x86_64) on OS X 10.11.3
>>> from sklearn import pipeline, model_selection Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'model_selection' tried:
update six, sk-learn,
sudo pip uninstall python-dateutil sudo pip install python-dateutil==2.2 pip2 install six -U pip install --ignore-installed six pip install --ignore-installed ipython even reinstall anaconda ... NOT fixed.
thanks for the help
_________ Updata ________
I checked that my six version is the newest ( version = "1.10.0")
import sklearn
sklearn. version '0.17.1'
I found that there is no folder name "model_selection" in the sklearn folder. But there is this folder at https://github.com/scikit-learn/scikit-learn/tree/3078d7d611329c46777d4004a1185a3626558efe/sklearn .
After installing the dev version on
$ pip install git + git: //github.com/scikit-learn/scikit-learn.git
Successfully installed scikit-learn-0.18.dev0
And then run the script that runs successfully in 0.17.1, it shows an error:
from .pairwise_fast import _chi2_kernel_fast, _sparse_manhattan ImportError: dlopen (/Users/Username/anaconda3/lib/python3.5/site-packages/sklearn/metrics/pairwise_fast.cpython-35m-darwin.so, 2): libl library .dylib Link: /Users/Username/anaconda3/lib/python3.5/site-packages/sklearn/metrics/pairwise_fast.cpython-35m-darwin.so Reason: image not found
What version of scikit-learn are you using? It seems like the last one when I install for Python 3.5 is 0.17.1. Check in the console:
import sklearn sklearn.__version__ '0.17.1' According to the documentation for this version, the package "model_selection" does not exist. It exists in the dev version . That is why he complains.