Sen2cor 2.8.0 Product version cannot be read (trying to run in python)

I have sen2cor downloaded as a standalone product (using windows).

I’ve added it to path and when I call it from within the virtual env I set up/command line it works fine.

But I need to add it into a python script, and I tired to do this with the following:

os.system("L2A_process --resolution 10 " + path_to_SAFE_folder)

and I get this error:
"Product version cannot be read.
14.5 will be used by default, but warnings during validation might occur.

Sen2Cor 2.8.0: Product version cannot be read."

I also tried using subprocess instead of os and I get an error saying:
“TypeError: ‘module’ object is not callable”

Should I be calling this another way or is there a direct python sen2cor library I’m not aware of?

I don’t know if this changes anything, but as you want the highest resolution anyways, you can leave out the --resolution 10 in the command and simply call the batch and the folder.

Maybe worth a try.

Tried that but getting the same error

Product version cannot be read.
14.5 will be used by default, but warnings during validation might occur.

Sen2Cor 2.8.0: Product version cannot be read.

hm, just based on other topics I found on this error: Are the images stored in folders with very long path?

oh yes, to map to the .SAFE file it’s 198 chars. will try a shorter path and see what happens

looks like that worked!

very good!