简体   繁体   中英

How to auto install missing module in python?

I want to release my simple python script which use some extended module such as argparse and watchdog . I don't think it reasonable to make the assumption that user of my script already has these modules installed. So I think I should include a configure script to test user environment (if I can automatically install these missing modules, that couldn't be better:P) in the release.

My question is: is there any utilities like configure for c program. If no such things, is it possible to adapt configure to python environment? Otherwise I have to compose some from scratch:(.

Thanks and best regards.

查看setuptools ,特别是文档。

use PIP with a text file stating all required modules. like so:

pip install -r requirement.txt

see: http://www.pip-installer.org/en/latest/requirements.html

You can also use pip to install the modules. PIP is replacement of easy_install .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM