pythonscikit-learnactivepython

Python loading old version of sklearn


I've installed version 0.18.2 of scikit-learn on my Mac using

pip uninstall scikit-learn
pip install scikit-learn==0.18.2

However, when I run

python
>>> import sklearn
>>> sklearn.__version__

I get

'0.17'

Interestingly, this older version is still installed even after I uninstall scikit-learn. Could this have something to do with multiple versions of Python somehow being installed? I beat my head against the wall trying to use Anaconda at one point to try to get numpy and scipy running, and have since switched to ActivePython. When I run

which python

I get

/Library/Frameworks/Python.framework/Versions/2.7/bin/python

I know there are very similar questions on SO, but none of the posted solutions have worked.


Solution

  • Check your python path. On unix:

    echo $PYTHONPATH
    

    This will output all paths used for module imports. You might have some old version installed elsewhere.