Snappy Configuration on 64 bit Ubuntu 16.04 LTS failed

Hi,

When I configure the Snappy package on the 64 bit Ubuntu 16.04 LTS, it failed with the following info.

Configuring SNAP-Python interface…
java.io.IOException: Python configuration failed.
Command [/usr/bin/python2.7 ./snappyutil.py --snap_home /usr/local/snap --java_module /usr/local/snap/snap/modules/org-esa-snap-snap-python.jar --force --log_file ./snappyutil.log --java_home /usr/local/snap/jre --req_arch amd64]
failed with return code 139.
Please check the log file ‘/usr/lib/python2.7/dist-packages/snappy/snappyutil.log’.
** at org.esa.snap.python.PyBridge.configureJpy(PyBridge.java:223)**
** at org.esa.snap.python.PyBridge.installPythonModule(PyBridge.java:147)**
** 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(Thread.java:745)**
Python configuration error: Python configuration failed.
Command [/usr/bin/python2.7 ./snappyutil.py --snap_home /usr/local/snap --java_module /usr/local/snap/snap/modules/org-esa-snap-snap-python.jar --force --log_file ./snappyutil.log --java_home /usr/local/snap/jre --req_arch amd64]
failed with return code 139.
Please check the log file ‘/usr/lib/python2.7/dist-packages/snappy/snappyutil.log’.

When I opened the snappyulil.log file, the info is

INFO: Installing from Java module '/usr/local/snap/snap/modules/org-esa-snap-snap-python.jar’
WARNING: Architecture requirement possibly not met: Python is x86_64 but JVM requires amd64
INFO: Installing jpy…
INFO: Extracting ‘lib/jpy-0.8.0-cp27-none-linux_x86_64.whl’ from '/usr/local/snap/snap/modules/org-esa-snap-snap-python.jar’
INFO: Unzipping '/usr/lib/python2.7/dist-packages/snappy/lib/jpy-0.8.0-cp27-none-linux_x86_64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to '/usr/lib/python2.7/dist-packages/snappy/jpyconfig.py’
INFO: jpy Java API configuration written to '/usr/lib/python2.7/dist-packages/snappy/jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to '/usr/lib/python2.7/dist-packages/snappy/snappy.ini’
INFO: Importing snappy for final test…

Does anyone meet this issue before? Thanks a lot.

Snappy installed on several Ubuntu 86_64 16.04 LTS systems without any problems, but we install snap separately for each user, not under a common directory in/usr/local. For example:

$ ~/snap/bin/snappy-conf /usr/bin/python2.7 Configuring SNAP-Python interface... Done. The SNAP-Python interface is located in '/home/gwhite/.snap/snap-python/snappy' When using SNAP from Python, either do: sys.path.append('/home/gwhite/.snap/snap-python') or copy the 'snappy' module into your Python's 'site-packages' directory.

If you want the snappy module in site-packages, you can do something like:

$ sudo mv ~/.snap/snap-python/snappy /usr/local/lib/python2.7/site-packages/

Did the user that ran snappy-conf have appropriate permissions to write into the site-packages directory?

Thank you for the kind reply. Yes, we have the permission to write to the site-packages.
There is a folder name snappy is generated, but once I run that an “Segmentation fault (core dumped)” is coming out.

I re-installed the snap in the folder /opt/snap, it has the same issue too. Thanks again

I suspect snappy-conf is running into a problem writing something outside the target snappy directory. One candidate for the problem is the snappy-properties file. Normally, snappy-conf writes $HOME/.snap/snap-python/snappy.properties. Is this properties file being created? If you have been using sudo for SNAP installs, you may have permission issues with $HOME/.snap.

Hi, I don’t know if two late to answer. But I had the same problem as you and I have solved it using a fresh virtual environment to use with snappy. I had created using the venv using conda

  1. Create the environment to use with snappy

    conda create --name snappy python=3.5

  2. Configure python to use snap-python (using the interpreter of our virtual environment)

    ./snappy-conf ~/anaconda3/envs/snappy8/bin/python