Icon

kn_​example_​python_​version_​check

KNIME/Python check versions of packages and system

KNIME/Python check versions of packages and system


KNIME/Python check versions of packages and system from pandas import DataFrameimport pandas as pdimport numpy as npimport pyarrowimport h2ovar_py_version = repr(sys.version_info)var_py_version_pandas = pd.__version__var_py_version_numpy = np.__version__var_py_version_pyarrow = pyarrow.__version__var_py_version_h2o = h2o.__version__# Create empty table# ------ store Python package versions in KNIME flow variablesflow_variables['var_py_version'] = var_py_versionflow_variables['var_py_version_pandas'] =var_py_version_pandasflow_variables['var_py_version_numpy'] =var_py_version_numpyflow_variables['var_py_version_pyarrow'] =var_py_version_pyarrowflow_variables['var_py_version_h2o'] = h2o.__version__output_table = pd.DataFrame( { "var_py_version" : [var_py_version],"var_py_version_pandas" : [var_py_version_pandas],"var_py_version_numpy" : [var_py_version_numpy],"var_py_version_pyarrow" : [var_py_version_pyarrow], "var_py_version_h2o" : [var_py_version_h2o] } ) # show all python packages in the bundled Python version of KNIMEimport knime.scripting.io as knioimport pandas as pdimport pip from pkg_resources import working_setinstalled_packages = [(i.project_name, i.version) for i in working_set]df = pd.DataFrame(installed_packages, columns=["Package_Name", "Version"])df = df.sort_values(by=['Package_Name'],ascending=[True], key=lambda x: x.str.lower())# df = df.sort_values(["Package_Name"],ascending=[True])df = df.set_index('Package_Name', drop=False)knio.output_tables[0] = knio.Table.from_pandas(df) KNIME and Python — Setting up and managing Conda environmentshttps://medium.com/p/2ac217792539 py3_knimeexport FlowVariables from KNIME^(?!knime.workspace).*$show packagesexport FlowVariables from KNIME^(?!knime.workspace).*$list all packagesfro the bundled KNIMEPython version Python Source(legacy) Conda EnvironmentPropagation Variable toTable Row Python Script Variable toTable Row Transpose Python Script KNIME/Python check versions of packages and system from pandas import DataFrameimport pandas as pdimport numpy as npimport pyarrowimport h2ovar_py_version = repr(sys.version_info)var_py_version_pandas = pd.__version__var_py_version_numpy = np.__version__var_py_version_pyarrow = pyarrow.__version__var_py_version_h2o = h2o.__version__# Create empty table# ------ store Python package versions in KNIME flow variablesflow_variables['var_py_version'] = var_py_versionflow_variables['var_py_version_pandas'] =var_py_version_pandasflow_variables['var_py_version_numpy'] =var_py_version_numpyflow_variables['var_py_version_pyarrow'] =var_py_version_pyarrowflow_variables['var_py_version_h2o'] = h2o.__version__output_table = pd.DataFrame( { "var_py_version" : [var_py_version],"var_py_version_pandas" : [var_py_version_pandas],"var_py_version_numpy" : [var_py_version_numpy],"var_py_version_pyarrow" : [var_py_version_pyarrow], "var_py_version_h2o" : [var_py_version_h2o] } ) # show all python packages in the bundled Python version of KNIMEimport knime.scripting.io as knioimport pandas as pdimport pip from pkg_resources import working_setinstalled_packages = [(i.project_name, i.version) for i in working_set]df = pd.DataFrame(installed_packages, columns=["Package_Name", "Version"])df = df.sort_values(by=['Package_Name'],ascending=[True], key=lambda x: x.str.lower())# df = df.sort_values(["Package_Name"],ascending=[True])df = df.set_index('Package_Name', drop=False)knio.output_tables[0] = knio.Table.from_pandas(df) KNIME and Python — Setting up and managing Conda environmentshttps://medium.com/p/2ac217792539 py3_knimeexport FlowVariables from KNIME^(?!knime.workspace).*$show packagesexport FlowVariables from KNIME^(?!knime.workspace).*$list all packagesfro the bundled KNIMEPython version Python Source(legacy) Conda EnvironmentPropagation Variable toTable Row Python Script Variable toTable Row Transpose Python Script

Nodes

Extensions

Links