Mac Update to 15.4 broke Python in KNIME
Dear KNIME Community,
I use the Python Script Node in KNIME. The workflow was working before in KNIME 5.4.3., but ever since updating my Mac version to the latest 15.4 version I get the following error log in the console.
ERROR Python Script 3:31 Execute failed: Could not connect to the Python process. WARN DefaultPythonGateway Python standard output: WARN DefaultPythonGateway Python standard error: Traceback (most recent call last): File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/init.py”, line 24, in from . import multiarray File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/multiarray.py”, line 10, in from . import overrides File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/overrides.py”, line 8, in from numpy.core.multiarrayumath import ( ImportError: dlopen(/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/multiarrayumath.cpython-311-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib Referenced from: /Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/libopenblas.0.dylib Reason: tried: ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/…/…/…/…/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/…/…/…/…/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/bin/…/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/bin/…/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/usr/local/lib/libgfortran.5.dylib’ (no such file), ‘/usr/lib/libgfortran.5.dylib’ (no such file, not in dyld cache) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/init.py”, line 130, in from numpy.config import show as show_config File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/config.py”, line 4, in from numpy.core.multiarrayumath import ( File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/init.py”, line 50, in raise ImportError(msg) ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed. We have compiled some common reasons and troubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: The Python version is: Python3.11 from “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/bin/python” The NumPy version is: “1.26.4” and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: dlopen(/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/multiarrayumath.cpython-311-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib Referenced from: /Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/libopenblas.0.dylib Reason: tried: ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/…/…/…/…/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/core/…/…/…/…/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/bin/…/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/bin/…/lib/libgfortran.5.dylib’ (duplicate LCRPATH ‘@loaderpath’), ‘/usr/local/lib/libgfortran.5.dylib’ (no such file), ‘/usr/lib/libgfortran.5.dylib’ (no such file, not in dyld cache) The above exception was the direct cause of the following exception: Traceback (most recent call last): File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/plugins/org.knime.python3.scripting.nodes5.4.1.v202501291500/src/main/python/knimescriptinglauncher.py”, line 57, in from knime.scripting._backend import ( File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/plugins/org.knime.python3.scripting.nodes5.4.1.v202501291500/src/main/python/knime/scripting/backend.py”, line 57, in import knime.scripting.deprecated.arrow_table as kat File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/plugins/org.knime.python35.4.0.v202411121656/src/main/python/knime/scripting/deprecated/arrowtable.py”, line 55, in import knime.arrow.backend as ka File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/plugins/org.knime.python3.arrow5.4.0.v202411121140/src/main/python/knime/arrow/_backend.py”, line 54, in import knime.arrow.types as kat File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/plugins/org.knime.python3.arrow5.4.0.v202411121140/src/main/python/knime/arrow/_types.py”, line 55, in import knime.arrow.dictencoding as kasde File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/plugins/org.knime.python3.arrow5.4.0.v202411121140/src/main/python/knime/arrow/_dictencoding.py”, line 54, in import numpy as np File “/Applications/KNIME 5.3.3.app/Contents/Eclipse/bundling/envs/orgknimepythonscripting/lib/python3.11/site-packages/numpy/init.py”, line 135, in raise ImportError(msg) from e ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there.
I reproduced this behavior on another machine, so it seems very likely that there is a direct relation between the Mac OS update and Python breaking in KNIME.
Does anyone have an idea on how I can fix this?