Pythonmodule ‘scipy.misc’ has no attribute ‘xxx’

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Python error module ‘SciPy. Misc’ has no attribute ‘imresize’

Solution:

To install the pilot package, the command is as follows:

pip install Pillow

Then restart the python environment

Python error module ‘SciPy. Misc’ has no attribute ‘imread’

Solution:

Most of the solutions are to say that PIL third-party library is not installed. The library name is now pilow. It is recommended to use the command PIP install pilow to install directly. However, my problem has not been solved. I still report an error attributeerror: module ‘science. Misc’ has no attribute ‘imread’
after searching and trying, it is found that there is a problem with the version of SciPy, which can be perfectly solved by demoting to SciPy = = 1.2.1

pip install scipy==1.2.1

reasons:

If you look at many of the latest versions of scipy.misc.imresize, you will find the following at the top:

Imresize is not recommended

Imresize is obsolete in SciPy 1.0.0 and will be removed in 1.3.0

Use pillow instead: numpy. Array (image. Fromarray (ARR). Reset())

The 1.3.0 release was released yesterday, so if SciPy is downloaded on the system today, you may have obtained a new version, which will no longer be able to use the function

The document I quoted above proposes a code snippet (using numpy and PIL) that can be substituted

therefore, the root cause of the above similar problems is still the problem of the SciPy version

Similar Posts: