ImportError: No module named sklearn.datasets

os: mac os yosemite
python: 2.7.6 — 64-bit
installed: numpy,skipy,matplotlib,nose

I get the following error.

>>> from sklearn.datasets import load_iris

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named sklearn.datasets

$ pip install --user --install-option="--prefix=" -U scikit-learn
Requirement already up-to-date: scikit-learn in /Library/Python/2.7/site-packages
Cleaning up...

Someone help me please!

Best answer

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
or export PYTHONPATH=$PYTHONPATH:’path where your installed modules are’

to find out the path where your modules are installed, try to run pip install again and it will output the location