1

Tried to use scipy.misc.imreadbut got an error AttributeError: 'module' object has no attribute 'imread'.

I know that I have to install PIL to use image functions as other SO question suggests. However, I got it installed but no help.

I have scipy installed via ScipySuperpack. PIL installed via pip. Using OS X machine.

Community
  • 1
  • 1
clwen
  • 20,004
  • 31
  • 77
  • 94
  • 2
    Look for the file `scipy/misc/pilutil.py`. If it is not there, I am guessing you have to install PIL first, then (re)install scipy. – unutbu Jun 13 '13 at 18:22
  • Actually `pilutil.py` is there... – clwen Jun 13 '13 at 18:42
  • 1
    In an interactive shell, if you `import scipy.misc`, then look at `scipy.misc.__file__`, does it show the a path to the same directory as the one containing `pilutil.py`? If so, open `__init__.py` in the same directory and look for any mention of `pilutil`. Perhaps post what you see here. – unutbu Jun 13 '13 at 19:18

2 Answers2

1

You have to import the module:

import scipy.ndimage
1

There is also the scipy extension scikit-image, which offers an abundance of image related operations: http://scikit-image.org/

torfbolt
  • 1,101
  • 12
  • 8