Skip to content

Python 3 development environment setup

Dominik Kutra edited this page Mar 15, 2021 · 7 revisions

note: this guide is outdated. Please follow the contributing guidelines in the main repo in order to get a dev environment going.

Setting up a new development environment for ilastik with conda and python 3 should be simple, just follow the steps below. If you need to build the packages yourself, see the building section at the bottom of this page.

Requirements:

  • Linux, Mac OS (>= 10.9), and Windows
  • Conda (download the one for your OS here, can be python 2 or 3, but 3 is preferred)

1. Install all of ilastik's dependencies with or without solvers:

If you do not have Gurobi or CPLEX, create a new environment with the ilastik-dependencies-no-solvers package by running:

conda create -n ilastik-py3 ilastik-dependencies-no-solvers python=3.6 numpy=1.12 -c ilastik-forge -c conda-forge

If you have Gurobi and/or CPLEX, use:

CPLEX_ROOT_DIR=/path/to/your/cplex GUROBI_ROOT_DIR=/path/to/your/gurobi/{{your-os}}64 conda create -n ilastik-py3 ilastik-dependencies python=3.6 numpy=1.12 -c ilastik-forge -c conda-forge

Note: Solvers are not supported on Windows yet

Note: We try to get the packages we depend on from conda-forge, but we need to build some ourselves. The ones that we have built can be found in our ilastik-forge conda channel, hence it is provided with the channel option -c above.

WARNING: It looks like currently (6. September 2017), there is a newer package for libgfortran in the defaults channel than in conda-forge, but we need the one from conda-forge. If you get an error message saying that you cannot import numpy due to a missing libopenblas, try the fix taken from here:

conda install libgfortran=3.0.0=0 -c conda-forge

2. Clone all ilastik repositories and make them available in the environment

To get ilastik in the development setup, clone ilastik-meta and get its submodules. We will refer to the path where you clone ilastik-meta as /your/path/to/ilastik-meta below.

git clone https://github.com/ilastik/ilastik-meta
cd ilastik-meta
git submodule init
git submodule update --recursive
git submodule foreach git checkout master

Then add a file ilastik-meta.pth to /your/path/to/conda/env/ilastik-py3/lib/python3.6/site-packages, with contents

/your/path/to/ilastik-meta/lazyflow
/your/path/to/ilastik-meta/volumina
/your/path/to/ilastik-meta/ilastik

3. Start ilastik

source activate ilastik-py3 # or "activate ilastik-py3" on windows
cd /your/path/to/ilastik-meta/ilastik
python ilastik.py

Building packages yourself

Building conda packages from the dependencies that were not present in any repository before, or that we have altered to suit our needs, is automated by the scripts in https://github.com/ilastik/ilastik-publish-packages

Building a release binary

To build release binaries, follow the instructions and use the scripts in ilastik-build-conda.

Clone this wiki locally