What\'s a good way to check if a package is installed while within a Python script? I know it\'s easy from the interpreter, but I need to do it within a script.
I g
A quick way is to use python command line tool. Simply type import You see an error if module is missing.
import
$ python Python 2.7.6 (default, Jun 22 2015, 17:58:13) >>> import sys >>> import jocker Traceback (most recent call last): File "", line 1, in ImportError: No module named jocker $