Problem: how to import numpy in subdirectory? Import error of numpy within subfolder.
Error message:
>>> import numpyTraceback (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_linalgImportError: libatlas.so.3gf: cannot open shared object file: No such file or directory
Possible causes:
1. the subfolders have their own numpy. py files.
2. Check the error of the last line. The libatlas. so.3gf cannot be found. Introduce the folder in which it is located to/etc/ld. so. conf.
$ Sudo gedit/etc/ld. so. conf
Write/usr/lib/atlas-base
$ Sudo ldconfig
See me @ Rachel Zhang :)