Checking a Python module version at runtime
问题 Many third-party Python modules have an attribute which holds the version information for the module (usually something like module.VERSION or module.__version__ ), however some do not. Particular examples of such modules are libxslt and libxml2. I need to check that the correct version of these modules are being used at runtime. Is there a way to do this? A potential solution wold be to read in the source at runtime, hash it, and then compare it to the hash of the known version, but that\'s