How to detect if numpy is installed


I'm writing Python code. I want to check if numpy and wxpython are installed on machine. How to do that??


Answers:


You can try importing them and then handle the ImportError if the module doesn't exist.

try:
    import numpy
except ImportError:
    print "numpy is not installed"