Changes between Initial Version and Version 1 of ChimeraPyPackages


Ignore:
Timestamp:
Sep 21, 2010, 12:50:36 PM (16 years ago)
Author:
Darren Weber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ChimeraPyPackages

    v1 v1  
     1
     2
     3== Installing Chimera and Python Packages for Chimera Development ==
     4
     5This page contains an example of a user installation of Chimera and additional configuration options to create a virtual python environment for development with Chimera.  The Chimera distribution currently ships with a custom build of python2.7 (as of Aug, 2010).  This custom python installation may not be compatible with any other installations of python on the system (including any site-packages in other python installations).  The following examples provide a tidy way to access and add new packages in a virtual environment derived from the Chimera python installation.  Also, see additional tips on Chimera development with [wiki:ChimeraEclipse eclipse-PyDev] and [wiki:ChimeraSpyder spyder].
     6
     7=== Installing Chimera ===
     8
     9Get a stable release or a [http://www.cgl.ucsf.edu/chimera/download.html#daily daily build of Chimera].  In the examples below, it was a daily build for a linux 64-bit system (dated 2010-08-24).  To run the installation, without superuser privileges:
     10
     11{{{
     12cd ~/Downloads/
     13chmod +x chimera-alpha-linux_x86_64.exe
     14mkdir -p $HOME/src
     15./chimera-alpha-linux_x86_64.exe
     16}}}
     17
     18Here's an example of the interactive prompts and replies:
     19{{{
     20UnZipSFX 5.41 of 16 April 2000, by Info-ZIP (Zip-Bugs@lists.wku.edu).
     21Original path: '/home/dweber/Downloads'
     22  inflating: chimera_install_35bPbx/installer 
     23  inflating: chimera_install_35bPbx/chimera.exe 
     24
     25Enter install location: $HOME/src/Chimera64-daily
     26Extracting files.  This may take a few minutes.
     27Executing command: './chimera.exe -q -d /home/dweber/src/Chimera64-daily'
     28UnZipSFX 5.52 of 28 February 2005, by Info-ZIP (http://www.info-zip.org).
     29
     30Install desktop menu and icon? yes
     31
     32To install desktop menu and icon, run:
     33
     34    $HOME/src/Chimera64-daily/bin/xdg-setup install
     35
     36If run as root, then it installs for all users,
     37otherwise it installs just for the current user.
     38
     39Install symbolic link to chimera for command line use in which directory?
     40    0 -- no link
     41    1 -- /usr/local/sbin
     42    2 -- /usr/local/bin
     43    3 -- /usr/sbin
     44    4 -- /usr/bin
     45    5 -- /sbin
     46    6 -- /bin
     47    7 -- /usr/games
     48[hit Enter for default (0)]:
     49}}}
     50
     51This installation did not use sudo privileges, so the install path was changed from {{{/opt/UCSF/Chimera64-2010-08-05}}} to {{{$HOME/src/Chimera64-daily}}}.  To install the desktop menu and icons:
     52{{{
     53$HOME/src/Chimera64-daily/bin/xdg-setup install
     54}}}
     55
     56Lastly, a few environment variables are set to simplify executing the new installation programs.  If your installation path is different, you will need to set the CHIMERA environment variable to your path.  The CHIMERA path must point to a hard-link, not a sym-link, in the directory tree.  '''Warning: do not set these environment variables for daily work with Chimera, they are to be set for a shell session that is only required during installation of additional python packages into the Chimera distribution of python.'''
     57{{{
     58# For a daily build, use:
     59export CHIMERA=$($HOME/src/Chimera64-daily/bin/chimera --root)
     60# For an svn-build, use:
     61#export CHIMERA=$($HOME/src/Chimera64-svn/bin/chimera --root)
     62export PATH=${CHIMERA}/bin/${PATH}
     63export LD_LIBRARY_PATH=${CHIMERA}/lib
     64}}}
     65
     66=== Adding python distribution tools to the Chimera installation ===
     67
     68Now get the [http://pypi.python.org/pypi/distribute distribute] or the [http://pypi.python.org/pypi/setuptools setuptools] package installed into the Chimera python installation.  Note the following has some version specific details that need attention for any current installation.  At the time of writing (Aug, 2010), this installation used a specific daily-build of Chimera (2010-08-24) and a specific version of setuptools for the version of python that was built for Chimera (python2.7).
     69
     70Option A: to use [http://pypi.python.org/pypi/distribute distribute], try the following:
     71{{{
     72cd ~/Downloads
     73curl -O http://python-distribute.org/distribute_setup.py
     74${CHIMERA}/bin/python2.7 distribute_setup.py
     75}}}
     76
     77Option B: to use [http://pypi.python.org/pypi/setuptools setuptools], try the following:
     78{{{
     79cd ~/Downloads
     80curl -O http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
     81sh setuptools-0.6c11-py2.7.egg --prefix=$CHIMERA
     82}}}
     83
     84Now it's easy to use these tools for installation of any additional python packages into the Chimera python distribution.  For example,
     85{{{
     86export CHIMERA=$($HOME/src/Chimera64-daily/bin/chimera --root)
     87export PATH=${CHIMERA}/bin/:${PATH}
     88export LD_LIBRARY_PATH=${CHIMERA}/lib
     89${CHIMERA}/bin/easy_install pylint
     90${CHIMERA}/bin/easy_install pyflakes
     91}}}
     92
     93=== A bash script to install setup tools and virtualenv ===
     94
     95Save this bash script into a location on your path (e.g., {{{${HOME}/bin}}}) and it can be called to install the {{{distribute}}} and {{{virtualenv}}} packages into the Chimera installation of your choice.  There is one command line argument, the full path to your Chimera installation.
     96
     97{{{
     98#!/bin/bash
     99# Default Chimera install path
     100CHIMERA="${HOME}/src/Chimera64-daily"
     101# Optional input parameter for Chimera install path
     102if [ $1 ]; then
     103        CHIMERA=$1
     104fi
     105# Test the existence of the $CHIMERA install path
     106if [ -d $CHIMERA ]; then
     107        echo "Chimera install path: ${CHIMERA}"
     108else
     109        echo "Invalid Chimera install path: ${CHIMERA}"
     110        exit 1
     111fi
     112export LD_LIBRARY_PATH=${CHIMERA}/lib
     113export PATH=${CHIMERA}/bin:${PATH}
     114mkdir -p ~/Downloads/
     115cd ~/Downloads/
     116rm -rf distribute*
     117curl -O http://python-distribute.org/distribute_setup.py
     118${CHIMERA}/bin/python2.7 distribute_setup.py
     119${CHIMERA}/bin/easy_install virtualenv
     120}}}