how to check if library is installed in python code example Example: check package version python import packagename print(packagename.__version__)