[Tutor] testing for modules?
kent37 at tds.net
Tue Oct 25 00:35:05 CEST 2005
Ed Hotchkiss wrote:
> i have a generic script that is using several modules on windows and
> linux boxes. i need to have the scripts test if a module is installed,
> and then if not - then to install the module. can anyone give me a
> headsup on how to test for a module, returning something to indicate
> whether or not it is installed, then after that executing file to
> install the module.? just somewhere to start would be helpful! thanks in
I don't know a generic way to install a module but the testing part is easy - just try to import it:
# install mymodule
In general you need to download and unzip a module, then run 'python setup.py install'.
More information about the Tutor