Hi there! I am having trouble running the Spacy nodes from Redfield NLP extensions due to error

Hi Knime community! I am wondering if you could help solve an error I am getting when trying to use the Spacy nodes from Redfield NLP extension. I am getting the following erros when tryin to run the Spacy Model Selector Node.

Hello @rmonterosapri

Could you please provide a more detailed log file? To do this try to configure or run the Spacy Model Selector node, once it fails to run please go to View → Open KNIME Log, and there please find the line with a full stack trace that only refers to this node.

Hi @Artem ! Thanks a lot! I think this is what you are referring right? Many thanks!:

The message is not full, please paste it as a text in the message using a preformatted text mode for better readability.

But so far, I can see that you have problems with Python environment. Please check the settings of Redfield NLP nodes. Probably the best option would be to select the Bundled environment.

Thanks @Artem here’s the text:

2024-01-19 11:53:45,251 : WARN : main : : Node : Spacy Model Selector : 3:436 : The Spacy model is not selected

2024-01-19 11:54:03,065 : ERROR : KNIME-Worker-12-Spacy Model Selector 3:436 : : Node : Spacy Model Selector : 3:436 : Execute failed: An unknown error occurred while trying to launch Python. See log for details.

java.lang.IllegalStateException: An unknown error occurred while trying to launch Python. See log for details.

at se.redfield.textprocessing.core.PythonContext.createKernel(PythonContext.java:67)

at se.redfield.textprocessing.core.PythonContext.<init>(PythonContext.java:48)

at se.redfield.textprocessing.core.model.download.SpacyModelDownloader.validateModel(SpacyModelDownloader.java:62)

at se.redfield.textprocessing.core.model.download.SpacyModelDownloader.isDownloaded(SpacyModelDownloader.java:50)

at se.redfield.textprocessing.core.model.download.SpacyModelDownloader.ensureDownloaded(SpacyModelDownloader.java:40)

at se.redfield.textprocessing.nodes.selector.SpacyModelSelectorNodeModel.execute(SpacyModelSelectorNodeModel.java:65)

at org.knime.core.node.NodeModel.executeModel(NodeModel.java:588)

at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1297)

at org.knime.core.node.Node.execute(Node.java:1059)

at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:595)

at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:98)

at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)

at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)

at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:367)

at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:221)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)

at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

Caused by: org.knime.python2.kernel.PythonInstallationTestException: Could not start Python. There are problems with your Python environment:

Could not start Python executable at the given location (no_conda_environment_selected\python.exe): Cannot run program "no_conda_environment_selected\python.exe": CreateProcess error=2, The system cannot find the file specified

at org.knime.python2.kernel.PythonKernel.testInstallation(PythonKernel.java:102)

at org.knime.python3.scripting.Python3KernelBackend.<init>(Python3KernelBackend.java:280)

at org.knime.python3.scripting.Python3KernelBackend.<init>(Python3KernelBackend.java:251)

at org.knime.python3.scripting.Python3KernelBackendFactory.createBackend(Python3KernelBackendFactory.java:70)

at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.createKernel(PythonKernelQueue.java:407)

at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.populateHolder(PythonKernelQueue.java:396)

at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.makeObject(PythonKernelQueue.java:381)

at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.makeObject(PythonKernelQueue.java:1)

at org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1051)

at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:347)

at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:270)

at org.knime.python2.kernel.PythonKernelQueue.dequeueHolder(PythonKernelQueue.java:298)

at org.knime.python2.kernel.PythonKernelQueue.getNextKernelInternal(PythonKernelQueue.java:282)

at org.knime.python2.kernel.PythonKernelQueue.getNextKernel(PythonKernelQueue.java:198)

at se.redfield.textprocessing.core.PythonContext.createKernel(PythonContext.java:59)

... 18 more

Additionally, I am not able to configure the Redfield extension in my preferences:

It seems more like a Python issue to me. Perhaps you can try re-installing Redfield NLP nodes extension, since it should provide a bundled Python environment, so user does not have to bother about Python installation.

I am not sure, but it might also be connected to the Windows specific issue that refers to too long file paths. Perhaps this solution might work for you as well:
https://docs.knime.com/latest/python_installation_guide/index.html?pk_vid=4539cfbff82e114217058165514cd8b3#windows-issues

And could you please specify what version of Knime are you using?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.