How can I install the Freeimage library in a Starcluster cluster so that it can be used with the scikit-image module?
I set up a cluster on AWS using Starcluster and I want to run some script that requires loading .jp2 images with the scikit-image module, which can be done with the Freeimage library. The command to do this is:
skimage.io.imread("path/to/image.jp2", plugin='freeimage)
. This works when I run it on my machine.
I have installed the scikit-image in my cluster using the Python packages plugin in the Starcluster config file as indicated in the Starcluster documentation:
[plugin pypackages]
setup_class = starcluster.plugins.pypkginstaller.PyPkgInstaller
packages = networkx, scikit-learn, scikit-image
I also installed the following packages into my cluster following the instructions in the documentation
[plugin pkginstaller]
SETUP_CLASS = starcluster.plugins.pkginstaller.PackageInstaller
PACKAGES = libfreeimage3, libfreeimage-dev
But when I run skimage.io.imread("path/to/image.jp2", plugin='freeimage)
in the cluster I get the following error message:
RuntimeError: Could not find a FreeImage library in any of:
/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins
/lib
/usr/lib
/usr/local/lib
/usr/lib
I am using OS X.
I was able to solve this by updating the Ubuntu installation on the Starcluster AMI to Ubuntu 14.04.
The problem was that Starcluster's AMIs are currently using Ubuntu 13 which, apparently is no longer supported. This means that installing packages through apt-get no longer works.
I was able to create an AMI with Ubuntu 14.04 following the instructions in the following video: https://www.youtube.com/watch?v=2RBupgpi_ec. Once I did that I was able to install libfreeimage3 and libfreeimage-dev as described in the question without problems.