How to automatically install third-party libraries in python?
怪我咯
怪我咯 2017-07-05 10:34:46
0
2
996

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?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
世界只因有你

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

为情所困

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template