Getting started

We use open software, this includes the operating system. So we try to do our part that it works...

After upgrading to Ubunut22.04, CellProfiler stopped working.The issue is linked the wxpython package which did not run in Python3.10. The issue can be overcome by installing Python3.8 and running CellProfiler in a Python3.8 environment. This instruction shows how you can make it happen. Start by checking your python version

python3 --version

In my case this is python 3.10.6. So you need to install a lower version python and set up a virtual environment for it. A guide for Python installation can be found here: Guide to Python installation on linux.

Installing a defined Python version, Ubunut 22.04

First install a "Personal Package Archive" (PPA) a software repository for Python versions. Take the deadsnakes repository

Don't change the version used by your operating system! This can break your system. Just install the Python verion you need in addition to existing python package. Then use the python version you need in a virtual environment.

Take these steps to install Python3.8

sudo apt update
sudo apt -y upgrade
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa

To check the status of a given version:

sudo apt-cache policy python(version)

I selected python3.8 for CellProfiler. To install a dedicated version:

sudo apt install python3.8

After you have installed Python3.8 there are a couple of additional packages which you need to install before you should set up the environment

sudo apt install python3-virtualenv
sudo apt install -y make gcc build-essential libgtk-3-dev
sudo apt-get install -y python3-pip openjdk-11-jdk-headless default-libmysqlclient-dev libnotify-dev libsdl2-dev
sudo apt-get install -y freeglut3 freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libjpeg-dev libsm-dev libtiff-dev libwebkit2gtk-4.0-dev libxtst-dev
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$PATH:/home/ubuntu/.local/bin
sudo apt install python3.8-distutils
sudo apt-get install python3.8-dev

Then make a virtual environment in python3.8

As venv is using the build in standard python version to make an environmnet, you cannot use it to make an environment with a different Python version. Therefore you need to use virtualenv, which you have downloaded before. In this example I am making an environment named "cp4_8". The extension is defining which Python version you would like to have in the environment

virtualenv cp4_8 --python=python3.8

Then activate the environment

source cp4_8/bin/activate

and check whether the environment has the desired python versioni

python --version

CellProfiler installation:

Do this in the activated CellProfiler environmnet

Numpy is required. Install it with:

pip install numpy

Then install CellProfiler

pip install cellprofiler

Everything fine? Did you get error messages? If yes, try to follow the error messages to install missing packages

To run cellprofiler type:

cellprofiler

After you are done, inactivate the python environmnet with:

deactivate

In general, to use cellprofiler, activate the environment, run cellprofiler, deactivate the environment