-1

My code worked fine in Ubuntu 12.04, but now I have error:

  from sklearn.metrics import accuracy_score   File "/usr/local/lib/python2.7/dist-packages/sklearn/metrics/__init__.py", line 6, in 
    from .metrics import (accuracy_score,   File "/usr/local/lib/python2.7/dist-packages/sklearn/metrics/metrics.py", line 25, in 
    from scipy.spatial.distance import hamming as sp_hamming   File "/usr/local/lib/python2.7/dist-packages/scipy/spatial/__init__.py", line 91, in 
    from .qhull import *  ImportError: /usr/lib/liblapack.so.3gf: undefined symbol: ATL_chemv

I don't understand what does this error mean and what should I do.

ali_m
  • 71,714
  • 23
  • 223
  • 298

3 Answers3

4

can try this

sudo update-alternatives --set liblapack.so.3gf /usr/lib/lapack/liblapack.so.3gf
Gunjan
  • 2,775
  • 27
  • 30
  • My comment is to state that this answer worked for me. – kcc__ Oct 19 '15 at 06:41
  • Hi, in my case I get this: `update-alternatives: error: no alternatives for liblapack.so.3gf`. Any ideas? I would be grateful. – xpanta Jan 21 '16 at 13:40
3

Here's my guess at what happened:

  1. The version of scikit-learn you installed back when you were running Ubuntu 12.04 was built against an older version of LAPACK, provided by liblapack.so.3gf.

  2. When you (presumably) upgraded Ubuntu from 12.04 to whatever version you're using now, LAPACK was also upgraded to a newer version. In versions of Ubuntu >= 13.04, the LAPACK dependency for the python-numpy package is provided by liblapack3, liblapack.so.3 or libatlas3-base, not liblapack.so.3gf.

  3. Now scikit-learn tries to link against the newer version at runtime, but fails because of an incompatibility between the older and newer versions of LAPACK.

I would suggest you first try uninstalling and reinstalling scikit-learn using pip. Hopefully scikit-learn will then be rebuilt against the new LAPACK library, and everything should work fine from then on.

If that doesn't work, I would then try uninstalling any currently installed LAPACK libraries. This will probably force you to also uninstall numpy and scipy. I would then install liblapack3, as well as libopenblas-base and libopenblas-dev (which provide a faster alternative to the standard BLAS libraries), then reinstall numpy, scipy and scikit-learn.

ali_m
  • 71,714
  • 23
  • 223
  • 298
0

Simply installing liblapack3 resolved the issue for me:

apt-get install liblapack3
Zahra
  • 6,798
  • 9
  • 51
  • 76