The only blog not featuring an ipod.

Installing ctrax on Ubuntu 11.04 Natty OR Debian jessie / wheezy [Updated 2014.07.14]

Ctrax is a video tracking software developed specifically to track trajectories of fruit flies.

Currently (Jan 2012), there are packages available for Ubuntu 10.04. If you want to install it in 11.04 you can't use those packages, you will get an error. My solution is the following.

NOTES:
This solution also works "as is" on debian whezzy, using ctrax version 0.5.0-1_amd64.deb (July 2014).
If you are running debian jessie, you might run into a couple of problems, whose workarounds are marked in bold below.

1. First some prerequisites and one package you Can install:
sudo apt-get install equivs python-setuptools python-dev python-matplotlib python-scipy python-wxgtk2.8 libavbin0

     Note: If you are trying this in debian Jessie, libavbin0 is not available for this version of the distro. You have to1. set up the sid repositories on your apt sources and run apt-get update2  install ONLY libavbin0, (apt-get install libavbin0)3. remove the sid repositories from your apt sources4. install the rest of the packages with sudo apt-get install equivs python-setuptools python-dev python-matplotlib python-scipy python-wxgtk2.8 


2. Get the latest version of ctrax from here. I tried this on 0.3.0-1_amd64 and 0.3.2-1_amd64.deb and 0.5.0-1_amd64.deb
Place it in a certain folder, say ~/ctraxinst and

cd ~/ctraxinst

3. Now, since this package depends on some python packages which are not available (or not in the correct version) for 11.04, it is necesary to install them by hand:

sudo easy_install motmot.wxvideo
sudo easy_install motmot.wxglvideo
sudo easy_install motmot.wxvalidatedtext
sudo easy_install motmot.imops
sudo easy_install pygarrayimage
sudo easy_install pyglet

4. This installs the python packages, the problem is that since they were not installed using the packaging manager, when we try to install ctrax it will report unmet dependecies. Here comes the dirty part, we will make some dummy packages and trick the packaging system into thinking this python modules are installed, well, not tricking because they actually are, lets call it, informing it of their installation.

mkdir fakes
cd fakes
equivs-control python-motmot-wxvideo
equivs-control python-motmot-wxvalidatedtext
equivs-control python-motmot-wxglvideo
equivs-control python-motmot-imops
equivs-control python-pygarrayimage
equivs-control python-pyglet

This will create six files named as the packages, in side each of them is the information on the respective fake package, we just need to edit one line in each of them. For example

nano python-motmot-imops

and make sure the 8th line says:

Package: python-motmot-imops

(this means you have to replace the defaults with line

Now you can actually build the packages



equivs-build python-motmot-wxvideo

equivs-build python-motmot-wxvalidatedtext
equivs-build python-motmot-wxglvideo
equivs-build python-motmot-imops
equivs-build python-pygarrayimage
equivs-build python-pyglet


this makes six .deb files which can be installed

sudo dpkg -i python-motmot-wxvideo_1.0_all.deb
sudo dpkg -i python-motmot-wxglvideo_1.0_all.deb
sudo dpkg -i python-motmot-wxvalidatedtext_1.0_all.deb
sudo dpkg -i python-motmot-imops_1.0_all.deb
sudo dpkg -i python-pygarrayimage_1.0_all.deb
sudo dpkg -i python-pyglet_1.0_all.deb


5. And now you can install the ctrax file you downloaded

sudo dpkg -i ../python-ctrax_0.5.0-1_amd64.deb


That should do the trick :)

NOTE:  In Debian jessie you might get an error, when running Ctrax, about matplotlib not finding one of its libraries. 
  File "/usr/lib/pymodules/python2.7/matplotlib/backends/tkagg.py", line 2, in
    from matplotlib.backends import _tkagg
ImportError: cannot import name _tkagg

I don't fully understand what the backends of matplotlib are, but one workaround for this is to use another backend. This can be done by editing matplotlib's config 
  sudo nano /etc/matplotlibrc
and changing the line backend      : TkAgg so that it reads:
   backend      : QT4Agg


This should do the trick.




Alguien me habló todos los días de mi vida al oido, despacio, lentamente. Me dijo: ¡vive, vive, vive! Era la muerte. (JS)