Closed brainfo closed 1 day ago
Hi @brainfo!
Javabridge can be quite tricky to install, I've been tempted to remove bioformats support for this reason. But let's see what we can do.
So you shouldn't need to install javabridge directly as python-bioformats==4.0.7 in the requirements.txt should install it, but it'll only work if it can find the jvm.
Let's check that it can find the jvm to start with. When I run java --version
on Ubuntu 20.04.2 I get:
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
If you don't see something similar then you will need to export $JAVA_HOME and check the version again to see that it worked. I can find my java location using readlink -f $(which java)
which points me to /usr/lib/jvm/java-11-openjdk-amd64/bin/java
so JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
.
Once it's correctly found your jvm location you can try the installation again.
Assuming this wasn't the problem you can try installing python-javabridge directly: pip install python-javabridge==4.0.3
or from github with:
pip install git+https://github.com/LeeKamentsky/python-javabridge.git#egg=javabridge
The javabridge PyPI package is outdated so python-javabridge should be used instead. Make sure to remove javabridge first.
Let me know if that works for you!
Hi @brainfo!
Javabridge can be quite tricky to install, I've been tempted to remove bioformats support for this reason. But let's see what we can do.
So you shouldn't need to install javabridge directly as python-bioformats==4.0.7 in the requirements.txt should install it, but it'll only work if it can find the jvm.
Let's check that it can find the jvm to start with. When I run
java --version
on Ubuntu 20.04.2 I get:openjdk 11.0.11 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
If you don't see something similar then you will need to export $JAVA_HOME and check the version again to see that it worked. I can find my java location using
readlink -f $(which java)
which points me to/usr/lib/jvm/java-11-openjdk-amd64/bin/java
soJAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
.Once it's correctly found your jvm location you can try the installation again.
Assuming this wasn't the problem you can try installing python-javabridge directly:
pip install python-javabridge==4.0.3
or from github with:pip install git+https://github.com/LeeKamentsky/python-javabridge.git#egg=javabridge
The javabridge PyPI package is outdated so python-javabridge should be used instead. Make sure to remove javabridge first.
Let me know if that works for you!
Hi Thanks! it worked as what you suggested!
Hi, I encountered the failed error when installing javabridge. I tried to first install openjdk-8 or 11 or 17 and export $JAVA_HOME respectively but no one worked
I tried to download the javabridge-1.0.19.tar.gz and python setup.py install still not working. And this gave more specific error messages:
I'm with python 3.10 on Ubuntu 22.04.3 LTS and installed like this:
Could you specify the OpenJDK version and javabridge version that should work in this case?
Thanks, brainfo