Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python scipy中缺少ndimage_Python_Scipy - Fatal编程技术网

Python scipy中缺少ndimage

Python scipy中缺少ndimage,python,scipy,Python,Scipy,我试图使用scipy的ndimage库,但它显然不存在。我已经运行了numpy和scipy的测试,结果还可以。我使用的是从sourceforge上的官方软件包安装的numpy 1.6.1和scipy 0.10.0 运行 import numpy import scipy import pprint print(scipy.version.version) print(numpy.version.version) img = scipy.ndimage.imread("") 给予 0.10.

我试图使用scipy的ndimage库,但它显然不存在。我已经运行了numpy和scipy的测试,结果还可以。我使用的是从sourceforge上的官方软件包安装的numpy 1.6.1和scipy 0.10.0

运行

import numpy
import scipy
import pprint

print(scipy.version.version)
print(numpy.version.version)

img = scipy.ndimage.imread("")
给予

0.10.0
1.6.1
回溯(最近一次呼叫最后一次):
文件“extract.py”,第8行,在
img=scipy.ndimage.imread(“”)
AttributeError:“模块”对象没有属性“nImage”

您必须导入模块:

import scipy.ndimage

模块应按如下方式导入:

from  scipy import ndimage
在scipy中找到init文件并添加导入ndimage


imread已被弃用!在SciPy 1.0.0中不推荐使用imread,并将在1.2.0中删除。改用
imageio.imread

我也有同样的问题,现在用你的方法解决了。但是在我的ipython解释器中,在
导入scipy
之后,使用
scipy.ndimage.filters.gaussian_filter1d
不会抛出错误。为什么?你确定这个语法吗?
from  scipy import ndimage