Problem with Python Snippet node (Windows Server 2008R2)

Dear All,

I have come up against a rather strange(?) problem with trying to use the python snippet node on KNIME 2.4.2 on Windows Server 2008R2.  It seems that a modified TEMP environment variable is bringing the problem to light...

ERROR PythonSnippetNodeModel Traceback (most recent call last): ERROR PythonSnippetNodeModel File "C:\Users\J40EA~1.DAV\AppData\Local\Temp\2\analyze6440060910671305615.py", line 214, in ERROR PythonSnippetNodeModel kIn = read_csv("C:\Users\J40EA~1.DAV\AppData\Local\Temp\2\knime2python1510715082601267868.csv", True) ERROR PythonSnippetNodeModel File "C:\Users\J40EA~1.DAV\AppData\Local\Temp\2\analyze6440060910671305615.py", line 143, in read_csv ERROR PythonSnippetNodeModel types = get_column_types(csv_filename) ERROR PythonSnippetNodeModel File "C:\Users\J40EA~1.DAV\AppData\Local\Temp\2\analyze6440060910671305615.py", line 65, in get_column_types ERROR PythonSnippetNodeModel csv_reader = csv.reader(open(csv_filename, 'rb'), delimiter=',', quotechar='"') ERROR PythonSnippetNodeModel IOError: [Errno 22] invalid mode ('rb') or filename: 'C:\\Users\\J40EA~1.DAV\\AppData\\Local\\Temp\x02\\knime2python1510715082601267868.csv' ERROR Python Snippet Execute failed: No python output table found, check script output

 

I think that installation (of KNIME?) under remote desktop has led to ....\Temp\2 as being registered as the temporary folder rather than \Temp.  This wouldn't ordinarily be a problem, but the python snippet node is interpreting Temp\2\filename.csv as Temp\x02\\filename.csv - and then (obviously) not finding it!

I have tried resetting the temp folder locations via the SET command in Windows, but this does not seem to trickle through to KNIME?

Any help greatly appreciated!

Kind regards

James

Hi James,

Does setting the temporary directory via

KNIME|File|Preferences|KNIME

help?

Cheers

Guido

Hi Guido,

Thanks for the suggestion - that did the trick!  (I had done a quick search for 'temp' in Preferences and couldn't find the setting!)

I am guessing that my temp path got set to this value during install because of remote desktop...  @Python Snippet developers - it would still be really useful if this could be looked at to avoid similar problems with paths?

Kind regards

James

Hi James, Hi Guido:

The path you had in there before is the default temp file path assigned by windows. I'm not sure whether the "/2/" is only because you installed via remote desktop; I doubt it.

Please also note, it is the python scripting node that you find in the KNIME community extensions (http://tech.knime.org/community/scripting), not the one offered by the knime core update site. We'll need to have the Max Planck people to take a look at the problem. I'll send a note to Antje.

Thanks,
  Bernd

Short question:

Do you use version 1.1 as python server?

 

Antje

Hi Bernd,

Here are some details I found about the default behaviour of Windows Servers temp folders, and access via remote desktop.  This behaviour can also be switched off - which I may do in future!  The info is from http://peoplesoft.wikidot.com/file-not-found-or-file-received-has-length-zero

but similar info is available on the microsoft sites:

 

Remove Desktop Access

The first issue is related to Microsoft Windows servers and administrators using terminal services/remote desktop. By default, Windows servers uses a separate temporary folder directory for each remote desktop user session. This alters where the %TMP%and %TEMP% environment variables (for the temporary folder location) will be. For instance, it will create a folder structure like this:

  • C:\Temp\1\… for user 1
  • C:\Temp\2\… for user 2
  • C:\Temp\3\… for user 3

It will then dynamically change the temporary folder location for each user. This causes havoc with the application server which might expect the temporary directory to exist under C:\Temp only.

To fix this situation, disable the use of temporary folders per session in the terminal service configuration settings as shown

 

Kind regards

James

Hi Antje,

I'm afraid I don't quite understand the short question... v1.1 of what?  I am not running a python server; just calling the server's local install of python (if that makes sense?)

Kind regards

James

Hi James,

so it seems that you are not using the python node from out scripting integrations as Bernd assumed?

Antje

Hi James,

kann you go to you KNIME-plugins folder and give me the full name of the python-jar please?

somthing like this:

de.mpicbg.tds.knime.scripting.python_???.jar

Antje

Hi Antje,

de.mpicbg.tds.knime.scripting.python_1.1.0.201112121427.jar

 

Thanks

James

That looks pretty recent.

Could you please check the preference settings for the python integrations? (maybe a screenshot would be the easiest way).

Thanks!

Antje

Hi Antje,

I have attached a screenshot.

Thanks

James

Hi James,

finally I can reproduce the problem. It seems to be a general problem when using the local python installation instead of the python server. To me it seems that it doesn't matter whether the temp-directory is ...\Temp\ or ...\Temp\2\

I'll give it a look.

Antje

Hi Antje,

I am facing the same problem as James right now, using the local version of Python. Has any solution been found so far?

Best regards,

Elena