First Contact with Snappy: RuntimeError

Dear all,

first thanks a lot to the nice tools and this forums, which just by reading already helped me a lot to get everything to run.
I installed and configured snappy (hopefully) correctly. Every error on the way seems to be fixed, but now I am struggling a problem, where I cannot find any help neither here nor in other forums (maybe just don’t know what to look for??)

When running the “First contact with snappy” code I got the following error from phyton:

  ` 
File "C:/Users/username/Desktop/untitled0.py", line 16, in <module>
 p = ProductIO.readProduct('snappy/testdata/MER_FRS_L1B_SUBSET.dim')

RuntimeError: java.io.FileNotFoundException: File not found: snappy\testdata\MER_FRS_L1B_SUBSET.dim

`

Whatever test I run, the error is more or less the same

RuntimeError: java.io.FileNotFoundException: File not found: XXX

Does anyone has an idea or how to figure out where the problem origins (somewhere in the Java configuration?)

I highly appreciate your help and knowledge
Thank you very much
Best
Jen

Have you tried an absolute path to the file?
You are using a relative path and your current working directory is probably your Desktop, because there is your python script located. readProduct will try to resolve the relative path against the current working directory.
But I assume that you don’t have the test data at C:/Users/username/Desktop/snappy/testdata/MER_FRS_L1B_SUBSET.dim

Dear Marpet,

Thank you for your fast response. Yes, I have tried to set the absolute path, but with the same error:

RuntimeError: java.io.FileNotFoundException: File not found: C:\Users\username\Desktop\snappy\testdata\MER_FRS_L1B_SUBSET.dim

And you have installed snappy into your desktop?
Is this product really located there? You might have done it like this, but it is pretty unusual.

Hi Marpet,

You are right, I have installed snappy into the user-directory directly. Nevertheless, meanwhile I have installed the SNAP-Toolbox and configured Python there. It was mentioned as the easiest way and indeed it is. Obviously, something must have been wrong with the manual installation (I guess some pathes were invalid?). After configuring python during SNAP installation directly, I am able to perform the python-tests as well (by pointing to the path of the test file directly).

It seems, that everything is ready to start :slight_smile:

I know this is an old question, but I also encounter this error. For me the solution was:
p = ProductIO.readProduct('testdata/MER_FRS_L1B_SUBSET.dim')
Since I was already in the snappy directory.