Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GenevieveBuckley/d17a94eac2293d0540d5881bc358dd6a to your computer and use it in GitHub Desktop.
Save GenevieveBuckley/d17a94eac2293d0540d5881bc358dd6a to your computer and use it in GitHub Desktop.
CellProfiler development installation on Ubuntu 20.04

CellProfiler development installation on Ubuntu 20.04

Guide created February 2021

1. Install dependencies

Install these dependencies

sudo apt update
sudo apt -y upgrade
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
#If and only if you are building your wxPython not from a wheel, you may need the following libraries:
#Otherwise, skip to the "export" steps
sudo apt-get install -y \
                freeglut3 \
                freeglut3-dev \
                libgl1-mesa-dev \
                libglu1-mesa-dev \
                libgstreamer-plugins-base1.0-dev \
                libgtk-3-dev \
                libjpeg-dev \
                libnotify-dev \
                libsdl2-dev \
                libsm-dev \
                libtiff-dev \
                libwebkit2gtk-4.0-dev \
                libxtst-dev

2. Add the java path to $JAVA_HOME and restart your terminal

sudo nano .bashrc

Add this line to your .bashrc file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

Restart your terminal for this change to take effect.

3. Install libwebkitgtk

sudo nano /etc/apt/sources.list

Add this line to your /etc.apt/sources.list: deb http://cz.archive.ubuntu.com/ubuntu bionic main universe

Now you will be able to install libwebkitgtk:

sudo apt-get update
sudo apt-get install libwebkitgtk-1.0-0 

4. Create your conda development environment

We create a Python 3.8 conda environment, and install wxPython and javabridge into it.

conda create -n cellprofiler-dev python=3.8 pip
conda activate cellprofiler-dev
conda install wxPython python-javabridge

5. Fork/clone the CellProfiler repository

Fork/clone the CellProfiler repository if you don't already have this.

git clone git@github.com:CellProfiler/CellProfiler.git
cd CellProfiler

6. Update the pinned numpy version

Must change pinned numpy version to "numpy==1.20.1" in CellProfiler setup.py (an upgrade from the current numppy pinned version 1.19.3)

nano setup.py

7. Install CellProfiler from the master branch

Editable installation of CellProfiler:

cd GitHub/CellProfiler
pip install -e .

8. Install cellprofiler-core from the master branch

Fork/clone CellProfiler core, if you don't already have this.

cd ..
git clone git@github.com:CellProfiler/core.git
cd core

Editable installation of CellProfiler core:

pip uninstall cellprofiler-core
pip install -e .

9. OPTIONAL - Install centrosome fromt the master branch

Fork/clone centrosome, if you don't already have this.

cd ..
git clone git@github.com:CellProfiler/centrosome.git
cd centrosome

Editable installation of centrosome:

pip uninstall centrosome
pip install -e .

10. Check everything is working properly

$ python
>>> import wx
>>> import javabridge
>>> # there should be no import errors
$ cellprofiler
$ # you should see the main CellProfiler window open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment