on 07-17-2023 10:22 AM - edited on 07-21-2023 08:06 AM by Tristan
When you use a Python package, you may want first to check a package's version that Incorta is using. In this article, you'll learn how to check the Python package's version in Incorta Notebook.
Please check out this article to learn how to install the package in Incorta Cloud.
If you have access to the cloud admin console, it can be as simple as opening the configurations and viewing what packages were installed and what version they are:
You will note that some packages, like pandas, are installed without a version number. When this was installed in the environment, it installed the most up-to-date version of pandas. To discover what that would be, go to option 2. If you can't access the cloud admin console, go to option 1B.
The simplest option is to use the __version__attribute to check. However, this option will only work if the package has been installed under a specific version number.
Use the __version__ attribute to check the Python package/library, __version__ attribute is recommended by PEP (Python Enhancement Proposals).
print(name.__version__)
There are two different approaches to finding a library version based on the version of Python in the Incorta environment. If you are not sure which one you have, run the following in an interactive notebook:
Check the Python version:
import sys
sys.version
If you're on Python >= 3.8, you can use a module from the built-in library for that. To check a package's version, run the following in an interactive notebook:
from importlib.metadata import version
version('module_name')
Use the following examples to return the a version response:
import sweetviz as sv
print(sv.__version__)
from importlib.metadata import version
from pandas_profiling import ProfileReport
version('pandas_profiling')