Updating sklearn from 0.14.1 to 0.16.1 does not work

I need to upgrade my sklearn installation to 0.14.1, since my current version does not have agglomerative clustering .

I downloaded the source for 0.16.1, extract it to the folder in which I start the installation using pip like this:

sudo pip install . 

Despite complaints about the lack of an atlas, as in the following fragment

 Installing collected packages: scikit-learn Found existing installation: scikit-learn 0.14.1 Not uninstalling scikit-learn at /usr/lib/python2.7/dist-packages, owned by OS Running setup.py install for scikit-learn Partial import of sklearn during the build process. blas_opt_info: blas_mkl_info: libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu'] NOT AVAILABLE openblas_info: libraries not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu'] NOT AVAILABLE atlas_blas_threads_info: Setting PTATLAS=ATLAS libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu'] NOT AVAILABLE atlas_blas_info: libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu'] NOT AVAILABLE /usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1521: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. warnings.warn(AtlasNotFoundError.__doc__) blas_info: FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] language = f77 FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] define_macros = [('NO_ATLAS_INFO', 1)] language = f77 sklearn/setup.py:73: UserWarning: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [blas]) or by setting the BLAS environment variable. warnings.warn(BlasNotFoundError.__doc__) unifing config_cc, config, build_clib, build_ext, build commands --compiler options 

Installation shows a successful message:

 Successfully installed scikit-learn Cleaning up... 

However, checking the scikit-learn version after installation shows 0.14, and AgglomerativeClustering is not imported. You can help?

+2
source share
1 answer

apt and pip are both package managers that you can use to install python packages around the world. Rule of thumb: Never mix two package managers who try to install them in the same directories.

In this case, pip was smart enough not to break the installation on apt , and so the old version was still present after the upgrade. The easiest fix is ​​to do apt-get remove python-sklearn .

It is best to strictly separate apt and pip when installing packages. I would recommend not using sudo pip at all. In this scenario, only apt allowed to install python packages globally. Locally, you can use virtualenv either directly or through anaconda to create isolated environments where you can install the latest packages.

+2
source

All Articles