How to Setup the Python Extension

Wed, 11/11/2015 - 00:00 winter

2019-03-21: We added more comprehensive instructions that will be continually updated. Check out the new documentation here.

 

With the new Python integration in KNIME you can use an existing Python installation from KNIME. But what if Python is not yet installed on the system? Here is a quick step by step guide on how to install Python and get it working in KNIME.

The Python nodes are already preinstalled if you are using one of the “KNIME + all free extensions” installation packages for Windows, Mac or Linux. If you are not using this KNIME version, the Python nodes can be added under "File→Install KNIME Extensions" by selecting "KNIME Python Integration" (see KNIME Update Site for more information on installing KNIME nodes). Please note that there is another Python Plugin called "KNIME Python Scripting extension" which is a Python integration provided by the community however this is not the subject of this blog post.

The following steps will show a possible way on how to install python on Windows, Mac OS and Linux. The Linux steps are for Ubuntu based distributions but can be easily adapted by changing the package manager command. In case the package manager does not provide all packages needed they can also be installed with pip.

 

Windows

  1. Download Anaconda (the Python 2 Version not 3)
  2. Start installing Anaconda (make sure that "Add Anaconda to my PATH environment variable" is checked)
  3. Open the Command Prompt
  4. Execute 'pip install protobuf'
  5. In KNIME go to"File→Preferences→KNIME→Python" and select the python.exe in the Anaconda directory

 

Mac OS

There are two options. Using the Homebrew package manager.

  1. Open the Terminal
  2. Execute ‘brew install python’
  3. Execute ‘pip install pandas protobuf jedi’
  4. In KNIME under "File→Preferences→KNIME→Python" enter /usr/local/bin/python (Homebrew default location).

Plain installation

  1. Open the Terminal
  2. Execute 'sudo easy_install pip'
  3. Execute 'sudo pip install pandas protobuf jedi'

N.B. The first option is preferred as it uses a Python installation separate from the system Python, which could avoid problems if you manage to screw up your Python installation!

Linux

Ubuntu:

  1. Open the Terminal
  2. Execute 'sudo apt-get install python-pandas python-protobuf python-jedi'

After these steps the Python integration should be ready to go. If required Python modules are missing or too old this will be indicated on the preference page.

 

Further reading: