5

So whenever I try

pip install -U scikit-learn 

I get:

ImportError: libatlas.so.3gf: cannot open shared object file: No such file or directory

I made sure I have atlas-base in my /usr/lib/ dir. What am I doing wrong?

Edit: clarifications, I'm doing this in a virtualenv.

Edit 2: Someone suggested me to use sudo apt-get install python-scipy and this is what I get when I try to import:

>>> import sklearn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.13-py2.7-linux-x86_64.egg/sklearn/__init__.py", line 32, in <module>
    from .base import clone
  File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.13-py2.7-linux-x86_64.egg/sklearn/base.py", line 9, in <module>
    import numpy as np
  File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 13, in <module>
    from polynomial import *
  File "/usr/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 17, in <module>
    from numpy.linalg import eigvals, lstsq
  File "/usr/lib/python2.7/dist-packages/numpy/linalg/__init__.py", line 48, in <module>
    from linalg import *
  File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 23, in <module>
    from numpy.linalg import lapack_lite
    ImportError: /usr/lib/liblapack.so.3gf: undefined symbol: ATL_chemv

Edit 3: After fixing some dependencies issue with numpy, I now get:

   import fblas
ImportError: libatlas.so.3gf: cannot open shared object file: No such file or directory
4
  • why not use the repo? sudo apt-get install python-scikits-learn
    – Uku Loskit
    Mar 29, 2013 at 17:46
  • I'm doing this in a virtual-env. Would that work?
    – Shelby. S
    Mar 29, 2013 at 17:46
  • Try import numpy or import scipy, if you still get same error, sudo apt-get install libatlas-base-dev may help you. It works for me.
    – Peter
    Mar 9, 2014 at 9:41
  • Installing the right scipy is key. If you're working in a python virtual env, try running pip install -UI scipy
    – arielf
    Sep 18, 2017 at 20:42

4 Answers 4

4

To get the dependencies try

sudo apt-get install python python-dev libatlas3-base-dev gcc gfortran g++

Also, you should check that numpy is up to date:

>> import numpy

>> numpy.version.version

'1.6.1'

(for example). I think you want numpy > 1.5.0 for the latest scipy distribution.

Then you can try the sudo apt-get install python-scipy command suggested in the other answers.

1

sudo apt-get install python-sklearn

Edit:

hdante@aielwaste:~$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
>>> 
3
  • 1
    same import error
    – Shelby. S
    Mar 29, 2013 at 17:50
  • sorry, I answered without considering any kind of sandboxing. You might need to consider to reload your virtual environment with the new installed packages.
    – hdante
    Mar 29, 2013 at 17:56
  • reloading virtual environment?
    – Shelby. S
    Mar 29, 2013 at 17:58
0
sudo apt-get install python-scipy
1
  • yea, I still get the Import error
    – Shelby. S
    Mar 29, 2013 at 17:49
-1

I can work by

echo "/usr/lib/atlas-base" | sudo tee /etc/ld.so.conf.d/atlas-lib.conf
sudo ldconfig

Thanks for this thread: https://unix.stackexchange.com/questions/52703/using-atlas-from-scipy

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .