3

Anaconda installs with Scipy, and in the scipy-0.12.0-np17py27_0.json file, this is listed:

"Lib/site-packages/scipy/misc/pilutil.py", 
"Lib/site-packages/scipy/misc/pilutil.pyc",

In the library folder, this is listed:

Lib/site-packages/scipy/misc/pilutil.py

But, running this:

import scipy.misc.pilutil as smp

Gives me this error:

AttributeError: 'module' object has no attribute 'pilutil'
JVE999
  • 3,327
  • 10
  • 54
  • 89

1 Answers1

3

The problem is that the scipy.misc.__init__ deletes the pilutil module - relevant code line - so you cannot import it directly. But all functions from the pilutil module are, before that, added to the misc module, and you can use them from there:

In [1]: from scipy import misc
In [2]: misc.fromimage
Out[2]: <function scipy.misc.pilutil.fromimage>
In [3]: misc.bytescale
Out[3]: <function scipy.misc.pilutil.bytescale>
Viktor Kerkez
  • 45,070
  • 12
  • 104
  • 85