For example, if the third-party requests library is used in the script,
when it is run by others, it may prompt that the library is missing. Is there any way to catch this exception and
directly help the user to install it automatically?
世界只因有你2017-07-05 10:36:46
You should write all the libraries you use into the requirements.txt file before letting others use the script
Then run pip install -r requirements.txt
为情所困2017-07-05 10:36:46
It can actually be done, but can you ensure that the missing module has the same name as the installed package? There are also version issues that need to be considered. Therefore, it is better to solve all the dependencies before thinking about this problem.