Check if module is installed

Kless jonas.esp at
Mon Aug 4 14:25:08 CEST 2008

How to check is a library/module is installed on the system? I use the
next code but it's possivle that there is a best way.

    import foo
    foo_loaded = True
except ImportError:
    foo_loaded = False

Thanks in advance!

More information about the Python-list mailing list