# Check for fastai and fastcore
'fastai')
check_package_installed('fastcore') check_package_installed(
True
check_package_installed (package_name:str)
# Check for fastai and fastcore
check_package_installed('fastai')
check_package_installed('fastcore')
True
check_package_version_with_version_attribute (package_name:str)
*Checks and returns the version of the specified package if available.
Args: package_name (str): The name of the package to check.
Returns: str or None: The version of the package or None if the package is not available.*
# Example usage
package_name = 'fastai' # Replace with any package name you want to check
version = check_package_version_with_version_attribute(package_name)
if version:
print(f"{package_name} version: {version}")
else:
print(f"{package_name} is not installed or does not have a version attribute.")
fastai version: 2.7.18
ensure_package_installed (package_name:str)
Check if a package is installed and install it if not.
install_package (package_name:str)
Install a package using pip.