.png)
- Article History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on
07-17-2023
10:22 AM
- edited on
07-21-2023
08:06 AM
by
Tristan
Overview
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.
Solution
Option 1A: Check Cloud Admin
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.
Option 1B: Check __version__ attribute
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__)
Option 2: Check the package version using Python built-in libraries
Check the version of Python
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
Python >= 3.8:
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')
Python < 3.8:
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')