Windows path missing in KNIME python

Dear all,

one of a sudden, I have problems calling windows excecutables through KNIME/Python.

This is due to missing path environmental variables.

When I display the %path% variable in the chosen Anaconda environment’s shell (or run the commands below from a native python console in that shell), it lists also the system environment paths.

When I run it from KNIME’s python nodes:

import os

os.system('echo %path%')

I only get the explicit Anaconda paths, not the system paths.

What can I do to have the system paths show up in KNIME as well (again, as it used to work…)?

Hi @MartinSchorb,

Did these problems occur after updating KNIME, Anaconda, and/or Windows, or is there anything else you recall having changed before the paths started to be missing?

Marcel

I noticed after the KNIME update to 4.3, but it also behaves the same way in 4.2.2. Windows updates might also have played a role. There certainly were some in between the script still working and when I discovered this…

I also tried with a full fresh reinstall of KNIME 4.3: same effect…

Next try:

  • fresh installation of the current Anacona (2020-11)

  • fresh installation of KNIME

  • install Python integration

import os

os.system('echo %path%')

gives only Anaconda-specific paths, no system path to the standard excecutables such as

os.system('notepad')

'notepad' is not recognized as an internal or external command,
operable program or batch file.

Could you try to use the Manual option in the Python Preferences (File > Preferences > KNIME > Python) to point to a startup script instead of selecting a Conda environment by name, and see if the problem persists? Creating the startup script is explained in our installation guide (Option 2: Manual).
It will look like this but with the correct paths and names filled in:

@SET PATH=<PATH_WHERE_YOU_INSTALLED_ANACONDA>\Scripts;%PATH%
@CALL activate <ENVIRONMENT_NAME> || ECHO Activating python environment failed
@python %*

We changed the way how Conda-based Python executables are run in KNIME 4.2 and I suspect this could be the reason why you experience these errors.

1 Like

works.

It seems that the Anaconda default launcher does not append %PATH% anymore… Or indeed, as you mention, KNIME calling the Anaconda scripts.

2 Likes

That is good news. Thanks for reporting! We will further investigate what/if something is going wrong on our side.

1 Like

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

Hi @MartinSchorb,

I just wanted to let you know that this problem has been fixed in KNIME Analytics Platform 4.3.2, which was released yesterday. Please let us know if you should ever encounter this problem again in any of the newer versions of KNIME. Thanks! :slight_smile:

Marcel

2 Likes