python - 关于 AttributeError : module 'scipy.misc' has no attribute 'imread'

标签 python numpy scipy

我正在尝试一些代码段,

from scipy import misc
im = misc.imread(file_image, True)

但是,我收到了错误消息,例如

AttributeError: module 'scipy.misc' has no attribute 'imread'

这可能是什么原因?

最佳答案

这是因为 scipy 从 1.2.0 开始停止使用 imread,要解决这个问题,您可以安装 Pillow

    pip install Pillow

或使用

降级到 1.1.0
    pip install scipy==1.1.0

关于python - 关于 AttributeError : module 'scipy.misc' has no attribute 'imread' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49685160/

相关文章:

python - 如何在 Python 中使用 for 循环对 DataFrame 进行子集化和列出?

python - 检查上三角矩阵或下三角矩阵

python - numpy.tensordot 命令如何工作?此命令中对轴求和的含义是什么?

python - 具有指定变量类型的线性优化模型

python - PIL 逊相关系数 2 尾 p 值含义

python - odeint <-> interp1d 相互作用中可能存在的错误?

Python:如何返回 os.walk 返回的每个文件的父目录名称?

python - Airflow "This DAG isnt available in the webserver DagBag object "

python - Python Tkinter : Cant configure button from another class

python - 在Python中移动矩阵行的最快方法