Cite numpy error explanation and solution

  • 2020-05-12 02:56:41
  • OfStack

numpy error solution


Problem: how to import numpy in subdirectory? Import error of numpy within subfolder.

Error message:


>>> import numpy 
Traceback (most recent call last): 
 File "<stdin>", line 1, in <module> 
 File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module> 
  from . import add_newdocs 
 File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module> 
  from numpy.lib import add_newdoc 
 File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 18, in <module> 
  from .polynomial import * 
 File "/usr/local/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 19, in <module> 
  from numpy.linalg import eigvals, lstsq, inv 
 File "/usr/local/lib/python2.7/dist-packages/numpy/linalg/__init__.py", line 50, in <module> 
  from .linalg import * 
 File "/usr/local/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 29, in <module> 
  from numpy.linalg import lapack_lite, _umath_linalg 
ImportError: libatlas.so.3gf: cannot open shared object file: No such file or directory 

Possible reasons:

1. There is a self-built numpy.py file under the subfolder

2. See the last row 1 mistake, can't find libatlas. so. 3 gf. Introducing their own folder/etc/ld so. conf, lack what fill what


$ sudo gedit /etc/ld.so.conf

Write/usr/lib/atlas - base


$ sudo ldconfig

Thank you for reading, I hope to help you, thank you for your support of this site!


Related articles: