>> import numpy ..."/>
您好,登錄后才能下訂單哦!
numpy出錯 解決方案
Problem: how to import numpy in subdirectory? Import error of numpy within subfolder.
錯誤信息:
>>> 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
可能原因:
1. 子文件夾下有自己建的numpy.py文件
2. 看最后一行的錯誤,找不到libatlas.so.3gf. 將其所在文件夾引入/etc/ld.so.conf,缺啥補(bǔ)啥
$ sudo gedit /etc/ld.so.conf
寫入/usr/lib/atlas-base
$ sudo ldconfig
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。