davidtbernal
davidtbernal

Reputation: 13684

ndimage missing from scipy

I'm trying to use the ndimage library from scipy, but its apparently missing. I have run the tests from both numpy and scipy and the results were OK. I am using numpy 1.6.1 and scipy 0.10.0 installed from the official packages on sourceforge.

Running

import numpy
import scipy
import pprint

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

img = scipy.ndimage.imread("")

gives

0.10.0
1.6.1
Traceback (most recent call last):
  File "extract.py", line 8, in <module>
    img = scipy.ndimage.imread("")
AttributeError: 'module' object has no attribute 'ndimage'

Upvotes: 33

Views: 42402

Answers (4)

Beginner
Beginner

Reputation: 11

https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imread.html

imread is deprecated! imread is deprecated in SciPy 1.0.0, and will be removed in 1.2.0. Use imageio.imread instead.

Upvotes: 1

Sanjeev Narayanan
Sanjeev Narayanan

Reputation: 1

Locate the init file in scipy and add import ndimage

Upvotes: -2

Rishi Ganesh V
Rishi Ganesh V

Reputation: 181

Modules should be imported like this:

from  scipy import ndimage

Upvotes: 18

davidtbernal
davidtbernal

Reputation: 13684

You have to import the module:

import scipy.ndimage

Upvotes: 65

Related Questions