See Use a module only if it is available.
In reply to Re: Best way to check for installed module by ehdonhon in thread Best way to check for installed module by jmay