from __future__ import print_function
import importlib
# check that all package are install
required_packages = { ' ',
' ',
}
problem_packages = list()
# Iterate over the required packages: If the package is not installed
# Ignore the exception
for package in required_packages:
try:
p = importlib.inport_module(package)
except ImportError:
probles_package.append(package)
if len(problem_packages) is 0:
print('All is well.')
else:
print('The following packages are required but not installed: + ','.join(problem_packages))
參考:
SimpleITK 00_Setup