numpy出錯 解決方案
創(chuàng)新互聯(lián)服務項目包括富民網(wǎng)站建設、富民網(wǎng)站制作、富民網(wǎng)頁制作以及富民網(wǎng)絡營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,富民網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務的客戶以成都為中心已經(jīng)輻射到富民省份的部分城市,未來相信會繼續(xù)擴大服務區(qū)域并繼續(xù)獲得客戶的支持與信任!
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
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!