Snappy error config installation


#1

Hi All!
I try install snappy how described here: https://senbox.atlassian.net/wiki/spaces/SNAP/pages/50855941/Configure+Python+to+use+the+SNAP-Python+snappy+interface
When i run: snappy-conf <python-exe> <snappy-dir>, i get error: …

[details=Summary]The launcher has determined that the parent process has a console and will reuse it for its own console output.
Closing the console will result in termination of the running program.
Use ‘–console suppress’ to suppress console output.
Use ‘–console new’ to create a separate console window.
Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
Configuring SNAP-Python interface…
java.io.IOException: Python configuration failed.
Command [c:\ProgramData\Anaconda2\python.exe .\snappyutil.py --snap_home “C:\Program Files\snap” --java_module “C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar” --force --log_file .\snappyutil.log --jvm_max_mem 5G --java_home “C:\Program Files\snap\jre” --req_arch amd64]
failed with return code 30.
Please check the log file ‘c:\Users\andre\.snap\snap-python\snappy\snappyutil.log’.
at org.esa.snap.python.PyBridge.configureJpy(PyBridge.java:232)
at org.esa.snap.python.PyBridge.installPythonModule(PyBridge.java:149)
at org.esa.snap.rcp.cli.SnapArgsProcessor.processPython(SnapArgsProcessor.java:103)
at org.esa.snap.rcp.cli.SnapArgsProcessor.process(SnapArgsProcessor.java:49)
at org.netbeans.modules.sendopts.DefaultProcessor.process(DefaultProcessor.java:202)
at org.netbeans.spi.sendopts.Option$1.process(Option.java:387)
at org.netbeans.api.sendopts.CommandLine.process(CommandLine.java:317)
at org.netbeans.modules.sendopts.HandlerImpl.execute(HandlerImpl.java:62)
at org.netbeans.modules.sendopts.Handler.cli(Handler.java:69)
at org.netbeans.CLIHandler.notifyHandlers(CLIHandler.java:234)
at org.netbeans.core.startup.CLICoreBridge.cli(CLICoreBridge.java:82)
at org.netbeans.CLIHandler.notifyHandlers(CLIHandler.java:234)
at org.netbeans.CLIHandler$1.exec(CLIHandler.java:268)
at org.netbeans.CLIHandler.finishInitialization(CLIHandler.java:447)
at org.netbeans.MainImpl.finishInitialization(MainImpl.java:256)
at org.netbeans.Main.finishInitialization(Main.java:92)
at org.netbeans.core.startup.Main.start(Main.java:316)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
at java.lang.Thread.run(Unknown Source)
Python configuration error: Python configuration failed.
Command [c:\ProgramData\Anaconda2\python.exe .\snappyutil.py --snap_home “C:\Program Files\snap” --java_module “C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar” --force --log_file .\snappyutil.log --jvm_max_mem 5G --java_home “C:\Program Files\snap\jre” --req_arch amd64]
failed with return code 30.
Please check the log file ‘c:\Users\andre\.snap\snap-python\snappy\snappyutil.log’.
[/details]

My PC config :
Win 10
Anaconda2 + python2.7
SNAP 6.0-PREVIEW5

My snappyutil.log: snappyutil.log (1,4 КБ)
snappy.ini: snappy.ini (216 Байт)

What should I change to properly configure it?


#2

sorry to ask you that but did you type < python-exe > and so on or are they just placeholders in your example?


#3

Of course, these are just placeholders, I did so:


#5

This is how it worked for me: Snappy.ini not found: make new one?

It is a bit different so maybe it helps you.


#6

How do you solve the problem in the end???


#7

Unfortunately, it was not possible to solve this problem. I even tried SNAP version 6.0.


#8

This error means that some library could not be loaded.
It is in a different scenario also mentioned on Stackoverflow
Maybe the error is that you have somehow mixed 32Bit and 64Bit. Maybe your anaconda is 32Bit and SNAP 64Bit? Could this be a reason?


#9

I switched this forum to read-only (except for admins) since SNAP 6.0 official is out. Perhaps this thread should be moved into an active forum?


#10

It seems I was able to solve the problem in windows 10.

I did the following:

1). Install Microsoft Visual Studio 11.0
I have a variable %VS110COMNTOOLS%

2). Install jdk-9.0.4 and jre-9.0.4

3). set JAVA_HOME=c:\Program Files\Java\jdk-9.0.4
set JDK_HOME=%JAVA_HOME%
set PATH=%PATH%;c:\Program Files\Java\jdk-9.0.4\bin

I checked that it works:
java --version

4). Download apache-maven-3.5.2-bin.zip.
Unpack and move in c:\Program Files\

  set PATH=%PATH%;c:\Program Files\apache-maven-3.5.2\bin

 I checked that it works:
 mvn -v

5). Download jpy-master in C:\Users\andre\Downloads\

cd C:\Users\andre\Downloads\jpy-master
python setup.py --maven build

I checked that it works:

6). cd c:\Program Files\snap\bin\

7). snappy-conf c:\ProgramData\Anaconda2\python.exe c:\Users\andre\.snap\snap-python\snappy

8). python
import snappy
from snappy import ProductIO

It Works!!!


#11

Hi

Thanks for this explanation.
I wonder having Visual Studio is necessary for a windows installation of Snappy? Why?


#12

There is a native part behind. It is called jpy. It is written in C.


It provides the bridge between python and java.


#13

Thank you very much Marco,
Sounds very promising!
I was almost crying when I though I had to install VS.
If you don’t mind I will report issues on the installation of t “jpy” on my Windows and Linux here.


#14

First Question :

Installing snappy (therefore jpy) on Linux Fedora 29 (64x)
Is it necessary to install a specific version of JKD (Is it OK to install the last version 11.0.2 ?)

The same question goes for installing it on windows 10 (64x)


#15

Hi
I am trying to follow the procedures that you brought here.
So far I did everything accordingly except the fist step (installing Visual studio)
Instead I installed Microsoft Visual C++ (only because it is lighter than installing the whole VS monster)
But now I am stuck at step 5. It seems to me that it does not recognize the path to the compiler. Bu I also manually added the installation address to the system path. I do not have any clue where to go from here…

I would appreciate any comment on this.
Maybe I should install the whole Visual Studio package after all ?


#16

Hello,

I have a similar issue with jpy. I have tried (unsuccessfully) many times to install SNAPPY with python 2.7.15 and 3.7.2. I use the SNAP GUI with no problem, but have never had any luck importing jpy or snappy.

Info:
MacOS 10.14.3, Mojave

java 11.0.2
Java™ SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
($JAVA_HOME = /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home, $JDK_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home)
Apache Maven 3.6.0 (PATH=/usr/local/Cellar/maven/3.6.0/bin/mvn)

After cloning the jpy repository,
git clone https://github.com/bcdev/jpy.git

and running the following line,
python setup.py --maven build jpy

I get the following warnings:
src/main/c/jni/org_jpy_PyLib.c:331:9: warning: implicit declaration of function ‘JPy_free’ is invalid in C99
[-Wimplicit-function-declaration]
JPy_free();
^
src/main/c/jni/org_jpy_PyLib.c:331:9: warning: this function declaration is not a prototype [-Wstrict-prototypes]
src/main/c/jni/org_jpy_PyLib.c:329:26: warning: unused variable ‘state’ [-Wunused-variable]
PyGILState_STATE state = PyGILState_Ensure();
^
src/main/c/jni/org_jpy_PyLib.c:791:16: warning: incompatible pointer to integer conversion returning ‘void *’ from a
function with result type ‘jlong’ (aka ‘long’) [-Wint-conversion]
return NULL;
^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:105:16: note:
expanded from macro ‘NULL’

define NULL ((void*)0)

           ^~~~~~~~~~

src/main/c/jni/org_jpy_PyLib.c:796:101: warning: passing ‘const char *’ to parameter of type ‘void *’ discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
result = executeInternal(jenv, jLibClass, jStart, jGlobals, jLocals, (DoRun)pyRunStringWrapper, codeChars);
^~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:657:128: note: passing argument to parameter ‘runArg’ here
…jenv, jclass jLibClass, jint jStart, jobject jGlobals, jobject jLocals, DoRun runFunction, void *runArg) {
^
src/main/c/jni/org_jpy_PyLib.c:1076:14: warning: incompatible pointer types assigning to ‘PyObject *’
(aka ‘struct _object *’) from 'struct _typeobject ’ [-Wincompatible-pointer-types]
pyObject = ((PyObject
) objId)->ob_type;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.

…and when running
python setup.py --maven bdist_wheel

It is successful, but with warnings:

Are you able to help? I’m happy to provide any further information as needed!

Thank you!

Ali


#17

Hi
I am still trying to fix this issue on my windows machine. Have not so far been successful. However the recent answer of the user WALT-H in this page helped me to install correct VS build tools. I followed all the steps as Andverh suggested and I managed to have everything setup however at the end of step 5 I still can not import jpy. I installed python 2.7 and things are still the same.