0
votes

I am using anaconda python

conda --v 
conda 4.3.25

I am trying to update sklearn package. I followed instructions from here: conda update scikit-learn (also scipy and numpy). When I try to install the packages, it shows that it is installing sklearn 0.19

conda install scikit-learn
The following NEW packages will be INSTALLED:
numpy:        1.13.1-py27_0     
scikit-learn: 0.19.0-np113py27_0
scipy:        0.19.1-np113py27_0
Proceed ([y]/n)? y

However, when I check package version, it still shows 0.15

import sklearn
sklearn.__version__
'0.15.2'

I further created environment in python.

$conda create -n sklearn python=2.7 anaconda

it shows below:

The following NEW packages will be INSTALLED:
scikit-image:       0.13.0-np112py27_0
scikit-learn:       0.18.1-np112py27_1

source activate sklearn

$python
Python 2.7.13 |Anaconda 4.4.0 (x86_64)| (default, Dec 20 2016, 23:05:08) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import sklearn
>>> sklearn.__version__
'0.15.2'

Further, when I looked at packages in pycharm I see both 15.2 and 19.1. Please see attached screenshot. enter image description here

How to resolve this? I see that packages get installed in to folder ./local/lib/python2.7/site-packages. Is this expected with Conda?

1
Make sure you are using the correct interpreter (it does not seem like that). Is your anaconda-based python used? For fun: check the version if scipy and compare with 0.19.1. - sascha
>>> scipy.__version__ '0.19.1' >>> numpy.__version__ '1.13.1' which python /anaconda/bin/python - Chandra
What is your PYTHONPATH environment variable? - darthbith
echo $PYTHONPATH is empty string - Chandra

1 Answers

-1
votes

I found that there was a conflict of conda package folder with pip installation folder. I checked for paths using

import sys

print sys.path

and found that pip installation folder has precedence over conda folder.

Deleting the pip installation folder solved this.