Which Python versions works better with Knime?

@JayR the thing is you will have to find the right combination of Python version and packages that would work with KNIME as well as your individual packages

What I would do

  • install Miniconda on your system (how to manage environments)
  • Choose a major Python version (like 3.8) that would most likely work with you package
  • look up a suitable YML file provided by KNIME (python version and operating system)
  • edit the file so it would suite your initial needs. Use only ‘conda-forge’ and add additional packages at the end and packages that are only available via PIP under the entry

For MacOS it might look like this:

name: py38_knime_2022    # Name of the created environment
channels:                # Repositories to search for packages
- conda-forge
dependencies:            # List of packages that should be installed
- pip
- python>=3.8,<3.9       # Python version
- py4j                   # used for KNIME <-> Python communication
- nomkl                  # Prevents the use of Intel's MKL
- pandas                 # Table data structures
- jedi                   # Python script autocompletion
- python-dateutil        # Date and Time utilities
- numpy                  # N-dimensional arrays
- cairo                  # SVG support
- pillow                 # Image inputs/outputs
- pyarrow=6.0            # Arrow serialization
- IPython                # Notebook support
- nbformat               # Notebook support
- scipy                  # Notebook support
- jpype1                 # Databases
- python-flatbuffers<2.0 # because tensorflow expects a version before 2
- h5py<3.0 # must be < 3.0 because they changed whether str or byte is returned
- protobuf>3.12
- libiconv               # MDF Reader node
- asammdf=5.19.14        # MDF Reader node
# ----------------------------------------------------
- openpyxl              # Excel Reader
- scikit-learn          # Machine Learning
# Visualization
- matplotlib
- bokeh
- seaborn
- pip:                   # add packages that would be installed thru PIP
  - snscrape             # scraper for social networking services

Create the environment via the miniconda prompt.

You can read more about how to use KNIME and Python in the guide:

https://docs.knime.com/latest/python_installation_guide/index.html#_introduction

2 Likes