How to run 'python setup.py install' from within Python?

后端 未结 6 1926
隐瞒了意图╮
隐瞒了意图╮ 2021-02-05 17:15

I\'m trying to create a generic python script for starting up a python app and I would like to install any dependent python modules if they are missing from the target system.

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 18:16

    For those, who use setuptools you can use setuptools.sandbox :

    from setuptools import sandbox
    sandbox.run_setup('setup.py', ['clean', 'bdist_wheel'])
    

提交回复
热议问题