Arch Linux - CellProfiler/CellProfiler GitHub Wiki
The following commands successfully installed Cellprofiler into an up to date Arch Linux system running GNOME in January 2024. This guide assumes you have an AUR helper such as yay installed - if not see https://github.com/Jguer/yay.
At this time, Arch ships with the most recent python version (3.11), however this is not supported yet by Cellprofiler. We need to install an earlier version of Python - 3.8 (tested, working) or 3.9 (not tested but believed to be working).
We also need an up to date java JDK development environment - make sure to install the full JDK, the JRE is not enough as it doesn't contain the javac compiler required to build the python-javabridge cellprofiler dependency.
Installation
Cellprofiler
yay jdk-openjdk
yay python38
cd && python3.8 -m venv cellprofiler
source cellprofiler/bin/activate
pip install numpy wheel
pip install cellprofiler
Run the program with:
cellprofiler
We can follow this up by installing Cellprofiler Analyst:
Cellprofiler Analyst
python3.8 -m venv analyst
source analyst/bin/activate
pip install wheel pandas seaborn scikit-learn python-javabridge verlib python-bioformats
cd analyst
git clone https://github.com/CellProfiler/CellProfiler-Analyst.git
cd CellProfiler-Analyst
pip install .
And we can run the program with:
python3.8 CellProfiler-Analyst.py
Running the programs
To run both programs in the future, ensure you have activated the relevant virtual environment by going back to your home directory cd then running the respective commands, either:
source cellprofiler/bin/activate then cellprofiler for Cellprofiler, or
source analyst/bin/activate then python3.8 CellProfiler-Analyst.py for Cellprofiler Analyst.
Troubleshooting
During pip install cellprofiler; python-javabridge failed to build; javac not found
Check that you have the jdk-openjdk AUR package installed as that package provides javac. If you have it already, you probably have or had an alternative java environment installed that is conflicting at the system level. Check the environments Arch has access to with
archlinux-java status
Then set the correct default with
sudo archlinux-java set jdk-openjdk
You should be able to complete the cellprofiler pip installation now.
Starting cellprofiler gives ImportError: [some library]: cannot open shared object file: No such file or directory
These errors occur because cellprofiler is expecting a system library that was there when cellprofiler was originally built, but which is no longer available to it (probably because of a system update).
You'll need to go through the install process again, so that cellprofiler builds whilst linking to the current system libraries. There may be a way of fixing the issue by diving into the files in the existing python environment, but this way worked for me.
Important: This will delete your cellprofiler application and virtual environment, but won't touch your images, exports, or program settings (assuming you've stored those elsewhere in your home directory (which would generally be the case).
First, make sure you're in the virtual environment.
cd && source cellprofiler/bin/activate
delete the existing pip packages so that a new build will be triggered when you reinstall cellprofiler.
pip cache purge
Then, delete your existing cellprofiler virtual environment.
cd && rm cellprofiler/*
rmdir cellprofiler
Then, you can go back to the installation instructions above (starting at the python3.8 -m venv cellprofiler line) to rebuild your cellprofiler application and associated packages.
Using GNOME DE, and unable to click on any elements in the main window
This seems to be a bug with the linux version of python or wxwidgets on gtk, but only under a wayland session. You can log out and switch to an X11 session in order to work around this issue until it is fixed upstream.