Cellprofiler Linux setup


Anyone can help me with the installation of Cellprofiler 3.1.8 in Ubuntu 16.04?

I’ve followed the steps of the installation (https://github.com/CellProfiler/CellProfiler/wiki/Source-installation-(Ubuntu-16.04-LTS)), and tried to use the version of 3.1.8 via

git checkout v3.1.8

The installation looks ok.

But when I run cellprofiler, this information appears:

ubuntu@cellprofiler:~$ cd CellProfiler/
ubuntu@cellprofiler:~/CellProfiler$ cellprofiler
Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/cellprofiler", line 11, in <module>
    load_entry_point('CellProfiler', 'console_scripts', 'cellprofiler')()
  File "/home/ubuntu/CellProfiler/cellprofiler/__main__.py", line 122, in main
    raise ValueError("You must specify a pipeline filename to run")
ValueError: You must specify a pipeline filename to run

The other issue is that the error I got from the Ubuntu interface directly looks different:

It seems that the GUI tried to pop-up but failed.
Peter Lu

Hi Peter,

I don’t think it’s possible to get CP 3.whatever to work on linux in headless mode. See my post here: CellProfiler install from source and run headless to solve batch processing memory errors Also see here: CellProfiler 4.0.0 timeline and roadmap

Since my post I’ve been using CP2 on ubuntu. Works great. If you get CP3 working let us know! -John

Hi John,

Thanks for your reply.
I get CP 3.1.8 working in Ubuntu16.04 to run the example pipelines (ExampleFly) in the data example.

Also, I am able to use 3.1.8 to run my designed pipelines now.

Though I’m also a beginner using Cellprofiler in Linux(ubuntu 16.04), my experience may help install this software:

  1. Just follow the first steps in this tutorial for ubuntu 16.04 here: https://github.com/CellProfiler/CellProfiler/wiki/Source-installation-(Ubuntu-16.04-LTS)

  2. When come to git check out, do

git checkout v3.1.8

  1. Upgrade pip from 8.1.1 to 9.0.1:

sudo python -m pip install --force-reinstall pip==9.0.1

  1. Install the python dependencies

sudo -H pip install .

  1. Upgrade pillow:

sudo -H pip uninstall pillow
sudo -H pip install pillow

  1. Run the Fly example:

cd cellprofiler/data/examples
find $PWD/ExampleFly/images/ -name “*.TIF” > filelist.txt

""quote symbol may not work, open the .txt to confirm the path of input image files

cat filelist.txt

cellprofiler -r -c -p ExampleFly/ExampleFly.cppipe --file-list=$PWD/filelist.txt -o .

Peter Lu

1 Like

Yes! You’re right, I got it working as well. Thanks for the check out tip and the encouragement. Great job! I did this:

sudo pip install pip==9.0.1
sudo pip install Pillow==4.3.0

and had to do this:
sudo pip install docutils==0.14

An CP3.1.8 seems to work in headless mode. Awesome! I was hesitating to reply though because the new problem is that big images are causing a java heap space error and it appears the “–java-heap-size” option on the command line was dropped after CP2.

I see this post here: https://github.com/CellProfiler/CellProfiler/issues/2048 but I’m not understanding how to use that in the command line. What I’ve tried so far hasn’t worked.


1 Like

Here we go. I ran this command before running the command to start CP:

export _JAVA_OPTIONS="-Xms32000m -Xmx32000m"

The underscore in front of the JAVA part appears to be important. Now when it’s CP is running it says “Picked up JAVA…”

1 Like

I am having problem in setting up CP3.1.8 in Ubuntu 16.04. I installed couple of weeks back, after a biit of struggle it was working fine. For the past two week again I am an issue as follows, here is the screenshot. It looks like an issue with h5py.


Really do not know how to solve your issue when I’m also new to use CP in ubuntu. But please let us know when you solve it~ Thanks!


I fixed the problem. The problem was h5py version. CP is looking for h5py 2.7 version i guess but I had 2.5. Whenever I try to update it was updating in the latest python (3.7) version. Actually I had two versions of python 2.7 & 3.7, but I was trying to run CP using 2.7 and so it was not working with the old h5py version. I removed both the python reinstalled 2.7. Once I complete the CP installation, I installed 3.7. Its working fine now.

Cool, that’s great!!

Actually, now I’m facing another problem:
when I run my dataset in batches, the error of “(worker) memory error” would appear.

I have 5 channels of each image sets, each image is smaller than 2M.


Dear Peter_Lu,

You can increase the number of workers in the preferences based on your capacity of the computer you are using.


Fujfilm Wako Automation (Consultant)

Hi Lakshmi,

Thanks for your suggestion. Actually, cellprofiler is able to detect the number of available VCPUs and adjust the number of workers automatically if using the GUI.
In my case, the default number of workers is 16, while my memory is only 32 GB. Now I decrease the number of workers to 6, no memory error appears.

Peter Lu

Hi Peter_Lu,



Fujfilm Wako Automation (Consultant)

jumping on this - if I get it right, you managed to get CP3 installed on Ubuntu 16 but it doesnt load the GUI? or can you run it from source normally?
also, do you know if there is an incompatibility with Jupyterlab?
we have jupyterlab installed on our Ubuntu16 server and are failing to install CP3 (stable) from source…

Hi @Debora_KellerOlivier,
Yes. It was getting installed following the steps from here, but the last step while loading Cellprofiler there was a problem. As mentioned in the above thread, the problem was with h5py version, which was inturn not getting updated because of my python Version. Later, when I removed completely all the python & updated h5py & then installed python, CP was working. I was not facing issue with Jupyterlab.
Could you please share the screenshot of the error or which step of installation you are facing issue, we could help you better.

Fujifilm Wako Automation (Consultant)
For CellProfiler training or optimised pipeline write to,

Read more on our site.
Yokogawa CV8000 - The Ultimate in Confocal HCS

Hi there,
we managed to install cellProfiler by changing the versions of numpy and sci-kit image as elow

For 3.1.9 version

  • clone https://github.com/CellProfiler/CellProfiler.git
  • check out v3.1.9
  • in setup.py, modify numpy==1.16.0, and scikit-image==0.14.2
    “matplotlib>=2.0.0, !=2.1.0”,
  • create new conda env, python 2.7
  • install with local user: pip install --user --editable .
  • try to launch cellprofiler and see printed output
  • install missing package with conda e.g. wx, … see package list in: https://github.com/CellProfiler/CellProfiler/wiki/Conda-Installation
  • missing wx ? : conda install -c daf wxpython=

though we now have an issue with keras/tensorflow backend when running the pipeline:

Worker 9:   File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 321, in placeholder
Worker 9:     x = tf.placeholder(dtype, shape=shape, name=name)
Worker 9: AttributeError: 'module' object has no attribute 'placeholder'

any idea?

Have you tried this ?

in progress… also following https://github.com/CellProfiler/CellProfiler-plugins/issues/91 and putative solution https://github.com/CellProfiler/CellProfiler-plugins/issues/90

Ok … what version of tensorflow do you have installed ? I would look at the second answer to the stackoverflow question in particular. The classifypixelsunet uses tensorflow 1.x, but the current version is 2.x (and that might have been installed).

1 Like

hehe, we just came to the same conclusion! thanks (I had github help )

Hi @Debora_KellerOlivier,

Hope you are able to resolve it!!

Fujifilm Wako Automation (Consultant)
For CellProfiler training or optimised pipeline write to,

Read more on our site.
Yokogawa CV8000 - The Ultimate in Confocal HCS