Ubuntu 18.04 - CellProfiler/CellProfiler GitHub Wiki

Right now, due to an ongoing wx issue, CellProfiler on Ubuntu18 seems to only work when installed inside a venv OR when you build wx from scratch (which can be very slow). We will update the instructions when these issues resolve.

sudo apt update
sudo apt -y upgrade
sudo apt install -y make gcc build-essential libgtk-3-dev
sudo apt install -y python3.8-dev python3.8-venv python3-pip openjdk-11-jdk-headless default-libmysqlclient-dev libnotify-dev libsdl2-dev libwebkit2gtk-4.0-dev

#If and only if you are building your wxPython not from a wheel, you may need the following libraries:
#Otherwise, skip to the "in a venv" steps
sudo apt-get install -y \
                freeglut3 \
                freeglut3-dev \
                libgl1-mesa-dev \
                libglu1-mesa-dev \
                libgstreamer-plugins-base1.0-dev \
                libgtk-3-dev \
                libgtk2.0-dev \
                libjpeg-dev \
                libnotify-dev \
                libsdl2-dev \
                libsm-dev \
                libtiff-dev \
                libwebkit2gtk-4.0-dev \
                libwebkitgtk-dev \
                libxtst-dev

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$PATH:/home/ubuntu/.local/bin

python3.8 -m  pip install \
  -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04  \
  wxPython==4.1.0

python3.8 -m pip install cellprofiler


## Otherwise, in a venv
python3.8 -m venv cellprofiler
source cellprofiler/bin/activate
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$PATH:/home/ubuntu/.local/bin

python3.8 -m pip install wheel

python3.8 -m  pip install \
  -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04  \
  wxPython==4.1.0

python3.8 -m pip install cellprofiler