Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question

migrated from stackoverflow.com Mar 29 '13 at 20:29

This question came from our site for professional and enthusiast programmers.

    
why not use the repo? sudo apt-get install python-scikits-learn –  Uku Loskit Mar 29 '13 at 17:46
    
I'm doing this in a virtual-env. Would that work? –  Shelby. S Mar 29 '13 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 at 9:41

3 Answers 3

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.

share|improve this answer
sudo apt-get install python-scipy
share|improve this answer
    
yea, I still get the Import error –  Shelby. S Mar 29 '13 at 17:49

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
>>> 
share|improve this answer
1  
same import error –  Shelby. S Mar 29 '13 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 '13 at 17:56
    
reloading virtual environment? –  Shelby. S Mar 29 '13 at 17:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.