To determine whether a module is installed, it is very simple, enter python in the terminal, and then enter the import module name. Then if the installation is successful without any prompt, the next
If you are prompted to report an error, it means there is a problem.
E.g
import re
You can see that the above program does not report an error, indicating that the re module has been installed
And for some modules, in addition to import, there are special test methods to test whether all the methods in the module can run normally, such as numpy and scipy, it is possible
The module is successfully installed, but some files fail to compile and some methods cannot be used. These modules will write their test methods in the documentation. Such as numpy.test() and so on.
Knowledge point expansion:
**Python check the module installation location **
python -v
import cv2
So far, this article on how python judges the module installation is complete is introduced. For more related python how to judge whether the module is installed, please search for ZaLou.Cn's previous articles or continue to browse the related articles below. Hope you will support ZaLou more in the future. .Cn!
Recommended Posts