Problem description
Today, when running a GitHub code two years ago, an error was reported:
from scipy.misc import imsave
ImportError: cannot import name 'imsave'
But after checking, I found that I have installed the SciPy module. When checking the internal function module of SciPy, I found that there are no functions such as imsave
import scipy.misc
print(dir(scipy.misc))
After searching, it is found that the reason is the SciPy version: after SciPy 1.3, functions such as SciPy. Misc. Imread/imsave will be discarded.
resolvent
To re install the previous version of SciPy, first log in to the official website of SciPy and find the corresponding WHL file. As the python environment of this machine is Ubuntu + python = 3.6.9, download the third corresponding file:
Then uninstall the previous SciPy and install the file
# uninstal scipy
pip uninstall scipy
# install
pip install scipy-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
Check the SciPy internal function again
You can see that there are functions like imread, imsave, imshow, etc
Read More:
- How to Solve Python ImportError: cannot import name UnrewindableBodyError
- [Solved] OpenCV Import Error: ImportError: numpy.core.multiarray failed to import
- Raspberry pie import opencv error: ImportError: numpy.core.multiarray failed to import
- [Solved] From pip._internal import cmdoptions ImportError: cannot import name SourceDistribution
- Keras import package error: importerror: cannot import name ‘get_ config‘
- How to Solve Python Importerror: DLL load failed: unable to find the specified program using tensorflow
- How to Solve Pychart configuration import torch error
- Solve the problem of error reporting from scipy.misc import imread & imresize in Python
- How to Solve M1 chip import numpy Error
- PyCharm: How to Solve Tensorflow_datasets Import Error
- Python Error: ImportError: cannot import name ‘logsumexp’ from ‘scipy.misc’(Anaconda3\lib\site-packages\scipy\misc)
- import statsmodels.api as sm Error: ImportError: DLL load failed while importing _arpack: The specified program could not be found.
- Pychart: How to Solve myspyder.items import myitem Error
- Python ImportError: numpy.core.multiarray failed to import
- How to Solve Python Pandas Read or Import Files Error
- [Solved] D2lzh_Pytorch Import error: importerror: DLL load failed while importing
- [Mac M1] How to Solve import wordcloud Error: ModuleNotFoundError: No module named ‘wordcloud‘
- Import win32API; importerror: DLL load failed: the specified program was not found
- [Solved] ImportError: cannot import name ‘delayed‘ from ‘sklearn.utils.fixes‘
- Tensorflow import Error: ImportError: libcuda.so.1: cannot open shared object file: No such file or dire