Can't get Snappy to interpret my code? [gpt <operator> -h]

I had the same issue with configuring snappy. Had to build a jpy wheel manually (they have instructions on their GitHub page). Additionally had to download and install JDK and Maven. I used an Anaconda environment for Python 3.6.

Edit: It was actually a long and annoying process, which I can write out step by step if someone still needs the details. It even involved modifying source code of jpy a little before compiling.

1 Like

perhaps you can write a guide and share updated code on github?

I don’t think it makes sense to share the code on GitHub, because I was just following the instructions from jpy’s main page and its issues, specifically this one.

Here is the outline:

  1. To build jpy, you need JDK installed (just searched “mac os install jdk”).
  2. JDK_HOME and JAVA_HOME environment variables need to point to the JDK installation. For zsh, I modified ~/.zshrc to include export JDK_HOME=$(/usr/libexec/java_home) and export JAVA_HOME=$JDK_HOME.
  3. Download the archive with the source code from the latest release of jpy.
  4. To actually build the wheel, you also need Maven, which I installed with brew: brew install maven.
  5. If python setup.py build maven bdist_wheel throws an error, you need to adjust the code as described by huayue21 in the issue I linked above and run it again.
  6. After that, everything went through fine for me. I just followed the instructions from snappy-conf to copy the wheel to the right folder and it worked.

Thanks. Your instructions will be very helpful for experienced users. Users who
don’t understand one of the steps should consider alternatives.

Did you use the Apple system Python3? This is not recommended for a couple reasons: a) inexperienced users may try to install packages in a system location, and
Apple may change Python3 with OS upgrades in a way that breaks snappy. In addition, snappy is much more well tested with Python 3.6, so there could be some
glitches with Apple Python3.

Step 1 should mention the required JDK version. I expect it should match the
SNAP supplied JRE (OpenJDK 1.8).

Less experienced users won’t have brew (step 4) (or macports, which should also provide maven, and probably a JDK as well) or understand the changes to ~/.zshrc (step 2). If you have brew (or macports, or another open source package installer) why not just install Python 3.6?

You should mention the error you encountered in step 5 in case others encounter different problems.

You are right! And honestly I’m not sure I’d recommend inexperienced users to try and fix the problem by themselves. Maybe there is an easier solution that I haven’t found, but this one requires familiarity with command line.

Here are some comments to your feedback:

I mentioned above that I used an Anaconda environment for Python 3.6, for exactly the reason you mentioned. I’d recommend using environments for most cases where you meddle with packages.

Honestly, I have no idea about the requirements for the JDK version, I just grabbed the latest available from the Oracle website. It hasn’t failed me yet. I have never worked with Java before.

The error I got is mentioned in another issue.