Replies: 20 comments 4 replies
-
Hi @fuho ! I'm not sure what is happening here, but let's figure it out. First, can you tell me if you can start the JVM with JPype? >> import jpype
>> jpype.startJVM()
>> That My first thought was to try setting My guess is that there's some OS library that the JDK depends on that has not been installed on your machine. Maybe try installing openjdk through your EndeavourOS's package manager, which should install any dependent libraries also? If neither of those help and you still get that error, I would suggest asking the JPype folks for guidance. |
Beta Was this translation helpful? Give feedback.
-
HEllo @hx2A ,
I actually made sure there is no JAVA_HOME set on purpose and installed it using install-jdk, thinking that it would be found (as mentioned here). |
Beta Was this translation helpful? Give feedback.
-
Right, but py5 knows to look for Java in the location where install-jdk installs Java. JPype doesn't know about that and won't know to look there. Can you try installing Java though your OS? I think in your case, that will work better. |
Beta Was this translation helpful? Give feedback.
-
Ok, added JAVA_HOME to my
I'll remove the |
Beta Was this translation helpful? Give feedback.
-
Removed
|
Beta Was this translation helpful? Give feedback.
-
OK, you are still getting that enigmatic MemoryError. I don't know what is causing that. How much memory does your machine have? I would suggest opening an issue with JPype and reference this issue. They might have seen this before. |
Beta Was this translation helpful? Give feedback.
-
64GB of RAM and it's not really claiming any... |
Beta Was this translation helpful? Give feedback.
-
The JPype docs say for Ubuntu users, you need to install this: sudo apt-get install g++ python3-dev I know Endeavour is not a Debian flavor of Linux but perhaps there is something unique about it where it needs certain packages to be installed first? |
Beta Was this translation helpful? Give feedback.
-
Interesting, lemme try that... |
Beta Was this translation helpful? Give feedback.
-
Ok, checked the libs and found out I already have all of them installed. |
Beta Was this translation helpful? Give feedback.
-
I'm out of ideas here. Try opening an issue with JPype and see what they say. |
Beta Was this translation helpful? Give feedback.
-
Yeah I think you're right... |
Beta Was this translation helpful? Give feedback.
-
@hx2A Actually just fixed this issue by force upgrading (against py5 requirements) jpype |
Beta Was this translation helpful? Give feedback.
-
Oh, OK! Glad you got that working! And yes I need to do a release to change the JPype requirement to >= 1.5.2. I made it == 1.5.0 because 1.5.1 had complicated problems for us. I'm seriously swamped right now and haven't added much to py5 since the last release but maybe I should do a release anyway, just to make this change? I will see what I can do. |
Beta Was this translation helpful? Give feedback.
-
Thank you @fuho! I have to test JPype 1.5.2 on Windows to see if it fixed some other troubling issues, 1.5.1 broke stuff and caused us to pin it to 1.5.0 on py5. Sounds like progress! |
Beta Was this translation helpful? Give feedback.
-
I'm on Garuda, which is also an Arch-based distro like EndeavourOS. I did some search and found this system config file related to $JAVA_HOME variable: /etc/environment:# This file is parsed by pam_env module
# Syntax: simple "KEY=VAL" pairs on separate lines
JAVA_HOME=/usr/lib/jvm/default
GRAALVM_HOME=/usr/lib/jvm/java-22-graalvm
TMPDIR=/tmp
PS1='[\u@\h \W]\$ '
COMP_WORDBREAKS=" /\'><;|&(" And its corresponding script for setting Java's current binary path: /etc/profile.d/jre.sh# Do not change this unless you want to completely by-pass Arch Linux' way
# of handling Java versions and vendors. Instead, please use script `archlinux-java`
append_path '/usr/lib/jvm/default/bin'
export PATH As mentioned by the "jre.sh" script, we should use BtW, this is my main Java package I've installed in my system: "jdk21-openjdk" >>> archlinux-java get
java-21-openjdk >>> archlinux-java status
Available Java environments:
java-21-openjdk (default)
java-22-graalvm
java-8-openjdk |
Beta Was this translation helpful? Give feedback.
-
@GoToLoop Thanks for this! I have installed two other jdk versions and successfully switched between them using Also I can confirm that py5 loaded with java21. |
Beta Was this translation helpful? Give feedback.
-
Awesome, glad you have it working, @fuho ! And thanks @GoToLoop for the info about that distribution. I'm going to do a py5 release with the jpype>=1.5.2 requirement once Processing does their next release, which should be by the middle of March. |
Beta Was this translation helpful? Give feedback.
-
I hope y'all don't mind I have converted this into a discussion, as it might remain more accessible for people searching for similar things and it might encourage people asking questions and reporting stuff here (I think I would think twice before asking more questions and reporting stuff on a closed issue). |
Beta Was this translation helpful? Give feedback.
-
Hi, I was just trying to install py5 (for the first time somehow!) on Linux Mint and ran into this same issue—I think this is the underlying JPype problem, which was fixed in 1.5.2. The strategy of force-upgrading to JPype 1.5.2 works fine... sort of. The problem is that the py5 package still lists JPype 1.5.0 specifically as a requirement, but JPype has removed pre-built binaries for that version from PyPI, which means that installing py5 in the first place now requires compiling JPype 1.5.0 from scratch... which in turn means that my students on macOS will need to download xcode tools or whatever to get started with py5. Less than ideal! A fix soon would be great (though not an emergency for me—I'll probably just fork the py5 package repository, bump the JPype dependency version there, and have my students install from my fork instead of PyPI for now). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am struggling to get py5 running on my laptop running EndeavourOS. I am using
venv
, installed java usinginstall-jdk
(Installed 17 as shown in the docs), py5 installed aspy5[extra]
. When importigpy5
I get:I don't have JAVA_HOME set, java is installed in ~/.jdk/jdk-17...
Beta Was this translation helpful? Give feedback.
All reactions