gpt4 book ai didi

numpy - undefined symbol : clapack_sgesv

转载 作者:行者123 更新时间:2023-12-04 23:28:23 24 4
gpt4 key购买 nike

我有这个小代码:

from numpy import *
from scipy import signal, misc
import matplotlib.pyplot as plt

path="~/pics/"
band_1 = misc.imread(path + "foo.tif");

H = array((1/2.0, 1/4.0, 1/2.0));
signal.convolve2d(band_1.flatten(), H)

plt.figure()
plt.imshow(band_1)
plt.show()

然后我执行此代码 python foo.py它抛出这个错误:
Traceback (most recent call last):
File "foo.py", line 2, in <module>
from scipy import signal
File "/usr/lib/python2.6/site-packages/scipy/signal/__init__.py", line 10, in <module>
from filter_design import *
File "/usr/lib/python2.6/site-packages/scipy/signal/filter_design.py", line 12, in <module>
from scipy import special, optimize
File "/usr/lib/python2.6/site-packages/scipy/optimize/__init__.py", line 14, in <module>
from nonlin import *
File "/usr/lib/python2.6/site-packages/scipy/optimize/nonlin.py", line 113, in <module>
from scipy.linalg import norm, solve, inv, qr, svd, lstsq, LinAlgError
File "/usr/lib/python2.6/site-packages/scipy/linalg/__init__.py", line 9, in <module>
from basic import *
File "/usr/lib/python2.6/site-packages/scipy/linalg/basic.py", line 14, in <module>
from lapack import get_lapack_funcs
File "/usr/lib/python2.6/site-packages/scipy/linalg/lapack.py", line 15, in <module>
from scipy.linalg import clapack
ImportError: /usr/lib/python2.6/site-packages/scipy/linalg/clapack.so: undefined symbol: clapack_sgesv

怎么了?好像是 from scipy import signal但我不清楚。

我已经检查了其他来源和论坛,但还没有原因:
  • http://old.nabble.com/scipy.interpolate-imports---%3E-lapack-errors-td30343730.html
  • http://permalink.gmane.org/gmane.comp.python.scientific.user/27290

  • 谢谢

    最佳答案

    在 Debian 上,您可以使用 update-alternatives ,假设您安装的不仅仅是引用实现。

    来自 debian wiki

    update-alternatives --config liblapack.so.3
    update-alternatives --config libblas.so.3

    关于numpy - undefined symbol : clapack_sgesv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8823692/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com