Immutable solution version
ImportError: cannot import name 'imread' from 'scipy.misc'
Complete solution
Fixes ImportError: cannot import name 'imread' from 'scipy.misc' Use when old code/tutorials doing `from scipy.misc import imread` on scipy>=1.3 Not for: you just need any image reader (use imageio or PIL directly)
How to fix ImportError: cannot import name 'imread' from 'scipy.misc'
scipy removed imread/imresize/imsave in 1.3. Replace from scipy.misc import imread with imageio (from imageio import imread) or PIL (Image.open(path)). imageio is scipy's own recommended replacement and returns the same numpy array.
The exact error
ImportError: cannot import name 'imread' from 'scipy.misc'Fix it
python -m pip install imageioExpected: installedReplace
from scipy.misc import imreadwithfrom imageio import imread. Expected: same numpy array backFor imresize: use
Image.fromarray(arr).resize((w, h))from PIL. Expected: equivalent resize
When this applies
old code/tutorials doing from scipy.misc import imread on scipy>=1.3
When this does NOT apply
you just need any image reader (use imageio or PIL directly)
Versions
scipy >= 1.3
Why it happens
scipy dropped its PIL wrappers; imageio became the blessed replacement.
Edge cases
imageio v3 changed the API slightly; imageio.v2.imread keeps the old behavior.
Evidence
Asked about: ImportError: cannot import name 'imread' from 'scipy.misc' (gh:oarriaga/faceclassification#160). The verified fix: scipy removed imread/imresize/imsave in 1.3. Replace from scipy.misc import imread with imageio (from imageio import imread) or PIL (Image.open(path)). imageio is scipy's own recommended replacement and returns the same numpy array. Full thread: https://github.com/oarriaga/faceclassification/issues/160
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_ZdtyBQgPnCuHQQUtH5KR2w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ImportError: cannot import name 'imread' from 'scipy.misc' <span>— Vectle</span></a>