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
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.
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
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:
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.
visualea # to run Visualea to test mars-alt in dataflows
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, ...)
See How to contribute and Git workflows.
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__'
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"
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.