11

After my Kubuntu (x86) has upgraded to 14.04, I got numpy not working in python 2.7:

Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
[GCC 4.8.2] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/prylipko/.local/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/home/prylipko/.local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/home/prylipko/.local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 13, in <module>
    from polynomial import *
  File "/home/prylipko/.local/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 17, in <module>
    from numpy.linalg import eigvals, lstsq
  File "/home/prylipko/.local/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 48, in <module>
    from linalg import *
  File "/home/prylipko/.local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 23, in <module>
    from numpy.linalg import lapack_lite
ImportError: /home/prylipko/.local/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so: undefined symbol: ATL_cpttrsm

I tried almost everything. Tried to re-install numpy (using pip), ATLAS, and LAPACK. I also tried to build numpy from sources, specifying the proper fortran compiler (gfortran=gnu95) used to build ATLAS.

Unfortunately, nothing helps. Could somebody suggest a recipe to fix it? I believe, I am not the only one in the Universe facing this problem. Thanks in advance.

Dmytro Prylipko
  • 4,762
  • 2
  • 25
  • 44
  • 1
    Sounds like something probably went wrong during the ATLAS build process, beyond that these things are rather tricky to troubleshoot. You might find [this guide](http://mbudisic.wordpress.com/2010/08/12/installing-atlas-with-full-lapack-on-64-bit-linux/) helpful. I'd also highly recommend using [OpenBLAS](http://www.openblas.net/) instead of ATLAS - in my experience it's been faster and way less fiddly to compile. – ali_m May 12 '14 at 22:34
  • Thank you for the hint. Using OpenBLAS did help. I found a guide for installing numpy/scipy with OpenBLAS here: http://osdf.github.io/blog/numpyscipy-with-openblas-for-ubuntu-1204-second-try.html – Dmytro Prylipko May 13 '14 at 10:35
  • I also wrote step-by-step instructions in my answer [here](http://stackoverflow.com/a/14391693/1461210). Leave a comment if you run into problems. – ali_m May 13 '14 at 10:53
  • 2
    It's a [bug](https://bugs.launchpad.net/ubuntu/+source/atlas/+bug/1336202). – Roland Smith Aug 07 '14 at 20:39

1 Answers1

6

I encountered this same error, running Python 2.7.3 under Ubuntu 12.04 LTS.

An August 14 comment posted on the bug report noted in the comment above by Roland Smith suggested the following solution, which worked for me:

pip install --upgrade numpy
Community
  • 1
  • 1
gumption
  • 1,108
  • 13
  • 10