引用numpy出错详解及解决方法

 numpy出错 解决方案

创新互联服务项目包括富民网站建设、富民网站制作、富民网页制作以及富民网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,富民网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到富民省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!

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

错误信息:

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

可能原因:

1. 子文件夹下有自己建的numpy.py文件

2. 看最后一行的错误,找不到libatlas.so.3gf. 将其所在文件夹引入/etc/ld.so.conf,缺啥补啥

$ sudo gedit /etc/ld.so.conf

写入/usr/lib/atlas-base

$ sudo ldconfig

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!


分享文章:引用numpy出错详解及解决方法
地址分享:http://pwwzsj.com/article/jicgoi.html