Solution to numpy errors referenced by subfolders

Source: Internet
Author: User

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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.