Tag Archives: Step on pit record

How to Solve Error “ImportError: cannot import name imsave“

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

JD GUI decompiles class file and reports internal error

Today, when decompiling a class file with JD GUI 1.4.0, we don’t see the decompilation result, only see the internal error, as shown in the following figure:

Google searched for it and found that it was in its official GitHub issue( https://github.com/java-decompiler/jd-gui/issues/197 )Luyten has a better tool for decompilation( https://github.com/deathmarine/Luyten )。

After downloading and using it, you can really open the class file that failed to decompile before.

Note: the following error occurred when using ﹣ luyten-0.5.3.exe:

The reasons may be as follows: my machine uses the non installation version of JDK 8, only specifies the path of JDK in the environment variable, and there is no JDK related information in the registry.

Solution: hold down the shift key, click the right mouse button, select “open command window here”, and enter: Java – jar luyten-0.5.3.exe in the open window

You can start Luyten normally.