Install PlantLab (developers)

Install development tools

  • git
  • gitk
sudo apt-get install git gitk

Install dependencies

If not yet installed, install external dependencies:

  • Pip (apt: python-pip)
  • scons (apt: scons)
  • zlib headers (apt: zlib1g-dev)
  • libpng headers (apt: libpng12-dev)
  • PyQt4 (apt: python-qt4)
sudo apt-get install python-pip scons zlib1g-dev libpng12-dev python-qt4

On ubuntu 14.04, you need to install ipython manually because packaged version is too old.

  • IPython 2.4.1
  • IPython Qt console
sudo pip install ipython==2.4.1
sudo pip install "ipython[qtconsole]"

Install Numpy, Scipy and Matplotlib:

  • Numpy (apt: python-numpy)
  • SciPy (apt: python-scipy)
  • matplotlib (apt: python-matplotlib)
sudo apt-get install python-numpy python-scipy python-matplotlib

Install pyqglviewer. Just follow instructions on PyQGLViewer website

Open a shell prompt and go to the directory where you want to install programs. For example:

cd $HOME/development

Then, download OpenAlea dependencies: deploy and sconsx

git clone https://github.com/openalea/deploy.git
git clone https://github.com/openalea/sconsx.git

These previous commands clone deploy and sconsx repositories, and must be executed only one time. Then, install OpenAlea dependencies. For these packages:

  • deploy
  • sconsx
cd package
python setup.py COMMAND

where COMMAND can be:

  • develop --user : to install in developer mode, in your home dir
  • develop --prefix=$HOME/local : to install in developer mode in directory of your choice
  • install : to do a system installation
  • install --prefix=... : to install in directory of your choice

Warning

If you don't know exactly what to do, please use: develop --user

Setup your environment

If not yet done, edit your .bashrc file (generally in /home/user/.bashrc) and add the following lines (if not yet in the file):

cd
gedit .bashrc
source ~/.openalea.sh
export PATH=$PATH:$HOME/.local/bin/
export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH

Save and close your .bashrc file. Open a new shell prompt and go to the directory where you want install programs.

Download PlantLab

Then, install openalea core components and plantlab

These commands clone all repositories and must be done only one time !

git clone https://github.com/openalea/openalea.git
git clone https://github.com/openalea/openalea-components.git
git clone https://github.com/openalea/plantlab

During svn -> git migration

Warning

If you want to use code from both gforge/svn and git, for example PlantGL and OpenAleaLab or Statistic tools and TissueLab, you need to desactivate modules in vplants that are available also in git:

please follow these steps:

  • open vplants/multisetup.py and remove (or comment with "#") these lines
    • "container" (now in github/openalea/openalea-components)
    • "svgdraw" (now in github/openalea/openalea-components)
    • "tissue" (now in gforge/tissue project)
    • "vtissue" (now in gforge/mars_alt)
  • reinstall deploy, sconsx, openalea and openalea-components from github
  • reinstall additional packages like plantlab or mars_alt

Update and install packages

For these packages:

  • openalea
  • openalea-components
cd package
python multisetup.py COMMAND

For this package:

  • deploy
  • sconsx
  • plantlab
cd package
python setup.py COMMAND
$HOME/.local/bin/alea_config

close terminal and reopen it.

Run programs

visualea # to run Visualea to test mars-alt in dataflows

Update packages

To get last version available, just do

cd package
git pull

Then reinstall packages like described in "Install packages" step above (cd package, python setup.py COMMAND, ...)

Contribute to packages

See How to contribute and Git workflows.

Troubleshooting

Multiple installation

To be sure you are using the right installation, you can run this command:

python -c 'import vplants.mars_alt; print vplants.mars_alt.__path__'

Error loading tiff images

Install python-libtiff

sudo apt-get install python-libtiff

Check libtiff is installed correctly

python -c "import libtiff"

If you get this message: ValueError: Failed to find TIFF header file (may be need to run: sudo apt-get install libtiff4-dev)

Diagnostic : File tiff_h_4_0_3.py is missing... Add this file in the folder : /usr/lib/python2.7/dist-packages/libtiff/

sudo cp tiff_h_4_0_3.py /usr/lib/python2.7/dist-packages/libtiff/

Try again :

python -c "import libtiff"

pkg_resources.DistributionNotFound: openalea.container

If you get an error message like this one:

Traceback (most recent call last):
  File "setup.py", line 54, in <module>
    "console_scripts": ["alea = openalea.core.alea:main"],
  File ".../lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File ".../lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File ".../lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File ".../openalea/deploy/src/openalea/deploy/command.py", line 972, in run
    set_env()
  File ".../openalea/deploy/src/openalea/deploy/command.py", line 813, in set_env
    dyn_lib = install_lib.install_lib(dyn_lib)
  File ".../openalea/deploy/src/openalea/deploy/install_lib.py", line 220, in install_lib
    egglibdirs = set(get_all_lib_dirs(precedence=INSTALL_DIST))
  File ".../openalea/deploy/src/openalea/deploy/util.py", line 134, in get_all_lib_dirs
    for e in egg_names:
  File ".../openalea/deploy/src/openalea/deploy/util.py", line 116, in get_eggs
    pkg = pkg_resources.get_distribution(project_name)
  File ".../site-packages/pkg_resources.py", line 345, in get_distribution
    if isinstance(dist,Requirement): dist = get_provider(dist)
  File ".../site-packages/pkg_resources.py", line 224, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File ".../site-packages/pkg_resources.py", line 668, in require
    needed = self.resolve(parse_requirements(requirements))
  File ".../site-packages/pkg_resources.py", line 571, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: openalea.container
Executing /usr/local/opt/python/bin/python2.7 setup.py develop ...processing

It is generally due to a partial uninstallation of python module.

For example if you've installed a package myapp that depends on mydeps, then you've uninstalled mydeps but you've kept myapp, this problem might appear. pkg_resources tries to load mydeps and fails. Solution is easy : reinstall mydeps or uninstall myapp.

Other troubles

For other troubles, see:

See troubleshooting page