Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So whenever I try

pip install -U scikit-learn 

I get:

ImportError: 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/", 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/", line 9, in <module>
    import numpy as np
  File "/usr/lib/python2.7/dist-packages/numpy/", line 137, in <module>
    import add_newdocs
  File "/usr/lib/python2.7/dist-packages/numpy/", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib/python2.7/dist-packages/numpy/lib/", line 13, in <module>
    from polynomial import *
  File "/usr/lib/python2.7/dist-packages/numpy/lib/", line 17, in <module>
    from numpy.linalg import eigvals, lstsq
  File "/usr/lib/python2.7/dist-packages/numpy/linalg/", line 48, in <module>
    from linalg import *
  File "/usr/lib/python2.7/dist-packages/numpy/linalg/", line 23, in <module>
    from numpy.linalg import lapack_lite
    ImportError: /usr/lib/ undefined symbol: ATL_chemv

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

   import fblas
ImportError: cannot open shared object file: No such file or directory
share|improve this question

migrated from 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 '14 at 9:41

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


(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-sklearn


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
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
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

I can work by

echo "/usr/lib/atlas-base" | sudo tee /etc/
sudo ldconfig

Thanks for this thread:

share|improve this answer

Your Answer


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.