今天在使用别人代码的时候,代码提示
ImportError: cannot import name multivariate_normal
虽然我已经安装了scipy库,但是由于版本较低,所以就报这个错误。
import scipy
print scipy.version.full_version
就可以查看scipy的版本号
解决上面问题的方法显然是更新scipy版本。
pip install scipy --upgrade
值得注意的是,如果你没有安装fortran是编译不过去的。
error: library dfftpack has Fortran sources but no Fortran compiler found
所以还需要安装fortran
sudo apt-get install fortran
本文介绍了解决在Python中使用scipy库时遇到的ImportError问题,特别是当尝试导入multivariate_normal时出现的问题。文章提供了检查scipy版本的方法,并指导读者如何通过升级scipy来解决问题,同时指出了如果遇到编译问题需要安装Fortran。
2845

被折叠的 条评论
为什么被折叠?



