Configure snap-py on MacOS

The different steps, I used to resolve this problem was :

  1. I had to choose the appropriate PATH from Python 3.7, when I launched the command line

./snappy-conf <python-PATH>

(Or at least, the one you use => you can check it with python3 --version)

If the ‘JPY’ module is not found with your python version, you can get the source code with this command line :

git clone GitHub - bcdev/jpy: A bi-directional Python-Java bridge used to embed Java in CPython or the other way round.
cd jpy

  1. After that, if you type :

python setup.py bdist_wheel

and you have an error as : "JAVA_HOME" must be set to a JDK (>= v1.7) installation directory), you have to export the PATH of JDK as :

export JDK_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/

(or your path) and,

export JAVA_HOME=$JDK_HOME

  1. If the error is linked to CLANG and GCC, you could resolve it, with this command line :

export CC=/usr/local/bin/gdc

After that, it should be work! Now you could type :

python setup.py bdist_wheel
cp dist/*.whl “/Users/floriane/.snap/snap-python/snappy”
./snappy-conf <python3-PATH>
cd <snappy-dir>

and the following commands are : https://senbox.atlassian.net/wiki/spaces/SNAP/pages/50855941/Configure+Python+to+use+the+SNAP-Python+snappy+interface

Hope it is enough clear…

1 Like