-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with install on mac M2 - import py5 in Jupyter causes kernel to die #316
Comments
Welcome, @buchholzmd ! Let's see if we can figure this out.
Starting the py5 kernel imports py5 for you, so let's focus on why the kernel dies when you import py5. And that's a pretty horrific error message you have there. There must be a problem of some kind with how the JDK was installed. Can you provide the output to Here's what I get on my Mac computer: % ipython
import Python 3.8.16 | packaged by conda-forge | (default, Feb 1 2023, 16:05:36)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import py5_tools
py
In [2]: py5_tools.get_jvm_debug_info()
Out[2]:
{'JAVA_HOME environment variable': '/usr/local/Cellar/openjdk/17.0.2/',
'jvm version': (0, 0, 0),
'default jvm path': '/usr/local/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home/lib/libjli.dylib'} |
The install-jdk library supports installing various JDKs and JREs builds. You can specify a different vendor besides the default Adoptium. You can also get the download URL it is attempting to use for debugging purposes: In [6]: import jdk
In [7]: jdk.get_download_url('17')
Out[7]: 'https://api.adoptium.net/v3/binary/latest/17/ga/mac/x64/jdk/hotspot/normal/eclipse'
In [8]: jdk.get_download_url('17', vendor='Azul')
Out[8]: 'https://cdn.azul.com/zulu/bin/zulu17.42.19-ca-jdk17.0.7-macosx_x64.tar.gz' Both of those URLs work for me right now. But if the default option gives you a 404 error, you can always try a different one. I suspect there is something amiss with how the JDK was installed on your computer. I know that |
That's it! Please don't install Java with anaconda. The JREs/JDKs that it will install are problematic. I've seen weird dependencies where installing matplotlib will downgrade your Java version, which makes no sense to me. I suggest starting with a new Anaconda environment and installing Java with |
Hmmm, something's wrong here. You shouldn't need sudo permission because it will by default install it in
But before opening an issue, can you try setting your |
Interesting, so a few things:
|
After setting In [1]: import os
In [2]: os.environ['JAVA_HOME']
Out[2]: '/usr/lib/jvm/java-17-openjdk' (My machine here is Linux w/ Java installed by the OS in |
I tried setting |
Hmmm, I don't understand what the issue is. Can you work on getting |
Yes, I started looking around a bit at past issues for It's trying to install in |
Can you create any directories in your home directory? |
@hx2A Yes, this is a new Mac, so this must be the case. What is weird is that I did grant permissions for folders under Thanks for the help, once I figure out how to run this not as root, I reckon things will be good to go! |
Some progress: for some reason, when using |
It's not Ananconda. Previously you said you first ran |
Ok, thank you. The problem was that I forgot to remove the full |
Can you try this in a regular Python interpreter: >>> import jpype
>>> jpype.startJVM() ? If this doesn't work, it must be a jpype problem, an issue with the JVM, or an issue your machine. In that case, I would try other JVMs options provided by install-jdk. Can you try with the default Adoptium? If that does work, it a py5 problem. I'm running out of ideas for what to do though. |
So starting JVM with Adoptium was giving the 404 error with install-jdk. I can try to download Adoptium either with brew or from a webpage and just setting JAVA_HOME based on that install maybe? |
Including the log for reference |
Can you double check you have the latest version of install-jdk? $ pip install install-jdk --upgrade
Requirement already satisfied: install-jdk in /home/jim/INSTALL/anaconda3/envs/py5/lib/python3.8/site-packages (1.0.4) It should be 1.0.4. Next, here is the download URL for adoptium Java 17: >>> jdk.get_download_url('17')
'https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse' Does that URL work for you in a browser? Is install-jdk still giving a 404 error? That should have been a temporary thing. Do you get a different download URL than me? You can also try installing Java with the appropriate DMG installer from here: https://www.oracle.com/java/technologies/downloads/#jdk17-mac That should be really easy to get working. Then remove or adjust |
Yes, I have 1.0.4, and btw I'm using python 3.9. The url you provided (for linux) does work, but for mac arm it's not working: running the However, I changed to this architecture and this url works: Still receive the same error of kernel dying. And btw, I initially tried the DMG install from Oracle's website. Just tried again with |
Maybe this is an architecture issue? Perhaps you get a 404 error because Adoptium does not have a build for the architecture install-jdk detects is correct for your machine? You can't install a build for a different architecture. This could explain why it is crashing the way that it is. |
Possibly... but what confuses me is that aarch64 is the correct architecture. And further, from my understanding aarch64 and arm64 are equivalent. So not sure what the difference between I've opened an issue with |
The different architectures are confusing to me, especially on the mac computers. Let's see what the install-jdk maintainer has to say. Side note: are you at NYU Courant? I graduated from there in 2005 with a MS in Math & Finance. |
Agreed - will keep this thread updated! And thanks for all the help btw And yes I am! I actually checked out your blog a few days ago and saw you were an alum. I watched the video of your ITP thesis and found it really cool! I actually worked with spherical convolutions a few times before and your work would have provided some useful references xD |
Any updates? Are you still trying to get py5 working on your machine? |
@buchholzmd Is this complete? Can I close this issue? |
I am going to close this. Please open a new issue for further mac problems. |
I followed these install steps but was unable to install Java 17 (or 20) using
install-jdk
due to a 404 error, so had to useopenjdk
.Upon starting the py5 kernel, it immediately dies. When using the created conda env as the kernel, the kernel dies after importing
py5
.I am using a mac M2. Jupyter gives the following error:
The text was updated successfully, but these errors were encountered: