简体   繁体   中英

ModuleNotFoundError: No module named 'scipy.misc.pilutil'

I am not able to import scipy.misc.pilutil

Though I have pillow and scipy installed. I am able to import scipy.misc but can't use functions like imresize

from scipy.misc.pilutil import imresize

ModuleNotFoundError                       
Traceback (most recent call last)

<ipython-input-20-a7ba6cfb7450> in <module>()
----> 1 from scipy.misc.pilutil import imsave

ModuleNotFoundError: No module named 'scipy.misc.pilutil'

You get this error because you are using scipy v1.3.0 and imresize() is deprecated. Also make sure you have Pillow installed.

See here: https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imresize.html

"imresize is deprecated in SciPy 1.0.0, and will be removed in 1.3.0."

Either downgrade to v1.2.x or use Pillow resize() instead: numpy.array(Image.fromarray(arr).resize()).

Check your scipy version. I had the same issue and after I've changed the scipy version to 1.1.0. the issue disappeared.

To check the scipy version in the terminal:

import scipy 
scipy.version.full_version

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM