- 1 year ago
Cannot import name 'imread', 'imresize', 'imsave' anaconda (windows)
If you're facing an import error for the functions imread
, imresize
, and imsave
in Anaconda on Windows, it's likely due to the fact that these functions are not part of the core OpenCV library.
In earlier versions of OpenCV (prior to version 3), these functions were part of the cv2
module, and you could use them directly. However, in OpenCV 3 and later versions, these functions were moved to the scikit-image
library.
To resolve the issue, you need to install the scikit-image
library in your Anaconda environment. You can do this by opening the Anaconda Prompt and running the following command:
arduinoconda install scikit-image
After installing scikit-image
, you can import and use the functions imread
, imresize
, and imsave
from the skimage
module:
pythonfrom skimage.io import imread, imresize, imsave
Make sure to update your code to use the correct module and function names.