添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

when running a python workflow that worked before (on Mac OS) on Windows with the latest Knime version, it threw this error I struggle to resolve:

WARN  Python Script        4:996:0:819:0:850 Traceback (most recent call last):
  File "<string>", line 9, in <module>
  File "C:\Program Files\knime_5.2.0\bundling\envs\org_knime_pythonscripting\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\knime_5.2.0\bundling\envs\org_knime_pythonscripting\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\knime_5.2.0\bundling\envs\org_knime_pythonscripting\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR Python Script        4:996:0:819:0:850 Execution failed in Try-Catch block: Execute failed: FileNotFoundError: [WinError 2] The system cannot find the file specified

I got these python extension installed

Geospatial Analytics Extension for KNIME 1.2.0.202311151543 sdl.harvard.features.geospatial.feature.group SDL, Harvard, Cambridge US KNIME Python Extension Development (Labs) 5.2.3.v202403181400 org.knime.features.python3.nodes.feature.group KNIME AG, Zurich, Switzerland KNIME AI Extension (Labs) 5.2.1.202402071416 org.knime.python.features.llm.feature.group KNIME AG, Zurich, Switzerland KNIME Extension for Apache Spark 5.2.2.v202403071725 org.knime.features.bigdata.spark.feature.group KNIME AG, Zurich, Switzerland KNIME Python 2 Integration (legacy) 5.2.0.v202311301708 org.knime.features.python2.feature.group KNIME AG, Zurich, Switzerland KNIME Extension for Local Big Data Environments 5.2.2.v202403071725 org.knime.features.bigdata.spark.local.feature.group KNIME AG, Zurich, Switzerland KNIME Python Integration 5.2.3.v202403221416 org.knime.features.python3.scripting.feature.group KNIME AG, Zurich, Switzerland KNIME Web Interaction (Labs) 5.2.0.202311291823 org.knime.python.features.web.feature.group KNIME AG, Zurich, Switzerland

Un. and reinstalling “KNIME Python Integration 5.2.3” threw this error and did not resolve the initial error either.

ERROR PythonGatewayTracker Found running Python processes. Aborting them to allow installation process. If this leads to failures in node execution, please restart those nodes once the installation has finished

Any advise?

Hi Mike @mwiegand,

the second point (Found running Python processes) can be ignored, that is more of an information.

The first point is more interesting.
The only extension of relevance should be your Python integration with version 5.2.3.v202403221416 and I see that you use the bundled environment there.
What happens in line 9 in the corresponding Python Script node? Could you send the script? From the first glance it seems that there could be a path which is read differently in Windows and/or is not valid on the Windows machine.

Best regards
Steffen

Hi @steffen_KNIME,

thanks for your quick response. Here is the script:

import knime.scripting.io as knio
import subprocess as sp
import pandas as pd
# equivalent to the input fields of the NGS bash node:
cmd = knio.flow_variables['Shell Command']
working_dir = knio.flow_variables["user.home"]
proc = sp.run(cmd.split(" "), cwd=working_dir, capture_output=True)
def get_lines_not_empty(stream):
    lines = stream.decode().splitlines()
    if len(lines) == 0:
        return [""] # because KNIME doesn't like a completely empty data frame
    else:
        return lines
df_stdout = pd.DataFrame({"StdOut": get_lines_not_empty(proc.stdout)})
df_stderr = pd.DataFrame({"StdErr": get_lines_not_empty(proc.stderr)})
knio.output_tables[0] = knio.Table.from_pandas(df_stdout)
knio.output_tables[1] = knio.Table.from_pandas(df_stderr)

The command executed is that (only changed the domain since customer specific):

nmap -v -F knime.com && nmap -v -F www.knime.com
Starting Nmap 7.95 ( https://nmap.org ) at 2024-05-17 12:26 W. Europe Summer Time
Initiating Ping Scan at 12:26
Scanning knime.com (75.2.60.5) [4 ports]
Completed Ping Scan at 12:26, 0.03s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 12:26
Completed Parallel DNS resolution of 1 host. at 12:26, 0.01s elapsed
Initiating SYN Stealth Scan at 12:26
Scanning knime.com (75.2.60.5) [100 ports]
Discovered open port 80/tcp on 75.2.60.5
Discovered open port 443/tcp on 75.2.60.5
Completed SYN Stealth Scan at 12:26, 1.90s elapsed (100 total ports)
Nmap scan report for knime.com (75.2.60.5)
Host is up (0.0068s latency).
rDNS record for 75.2.60.5: acd89244c803f7181.awsglobalaccelerator.com
Not shown: 98 filtered tcp ports (no-response)
PORT    STATE SERVICE
80/tcp  open  http
443/tcp open  https
Read data files from: C:\Program Files (x86)\Nmap
Nmap done: 1 IP address (1 host up) scanned in 2.18 seconds
           Raw packets sent: 202 (8.864KB) | Rcvd: 3 (132B)
Starting Nmap 7.95 ( https://nmap.org ) at 2024-05-17 12:26 W. Europe Summer Time
Initiating Ping Scan at 12:26
Scanning www.knime.com (99.83.231.61) [4 ports]
Completed Ping Scan at 12:26, 0.03s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 12:26
Completed Parallel DNS resolution of 1 host. at 12:26, 0.02s elapsed
Initiating SYN Stealth Scan at 12:26
Scanning www.knime.com (99.83.231.61) [100 ports]
Discovered open port 443/tcp on 99.83.231.61
Discovered open port 80/tcp on 99.83.231.61
Completed SYN Stealth Scan at 12:26, 2.12s elapsed (100 total ports)
Nmap scan report for www.knime.com (99.83.231.61)
Host is up (0.0070s latency).
Other addresses for www.knime.com (not scanned): 75.2.60.5
rDNS record for 99.83.231.61: acd89244c803f7181.awsglobalaccelerator.com
Not shown: 98 filtered tcp ports (no-response)
PORT    STATE SERVICE
80/tcp  open  http
443/tcp open  https
Read data files from: C:\Program Files (x86)\Nmap
Nmap done: 1 IP address (1 host up) scanned in 2.41 seconds
           Raw packets sent: 202 (8.864KB) | Rcvd: 3 (132B)
              

Could it be a whitespace issue (after all, you split for whitespace)? I also see somewhere C:\Program Files (x86). Maybe it makes a difference if you try with A) a KNIME Analytics Platform, B) a Python environment, C) with a cmd and/or D) with a working_dir without whitespaces?

Best regards
Steffen

Hi @steffen_KNIME,

executing the exact same command in CMD worked right away. I will, as I am on vacation with my daughter, check if the idea around spaces (maybe they need to get escaped?) at a later point in time.

Thanks