<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
This an example of getting some packages installed into the Chimera
python environment.  In my case, I was interested in using the spyder
IDE within the Chimera python installation.<br>
<br>
<a class="moz-txt-link-freetext" href="http://packages.python.org/spyder/">http://packages.python.org/spyder/</a><br>
<br>
First, get the setuptools (easy_install) package:<br>
<br>
$ sudo -i
<br>
# export PATH=$PATH:<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>opt/UCSF/Chimera64-2010-08-05/bin<span
 class="moz-txt-tag">/</span></i>
<br>
# export LD_LIBRARY_PATH=/opt/UCSF/Chimera64-2010-08-05/lib
<br>
# sh /home/dweber/Downloads/setuptools-0.6c11-py2.7.egg
--prefix=/opt/UCSF/Chimera64-2010-08-05/
<br>
<br>
That gets 'easy_install' working with the Chimera python installation.
<br>
<br>
Now for the spyder IDE.  It requires PyQt4, so it's not trivial, but
the following seems to build and install OK (against an Ubuntu package
install for Qt4, not a custom build of Qt4 in foreign; the wget
commands fetch linux-specific downloads):
<br>
<br>
$ sudo -i
<br>
# wget
<a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.10.5.tar.gz">http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.10.5.tar.gz</a><br>
# tar zxvf sip-4.10.5.tar.gz
<br>
# cd sip-4.10.5
<br>
# /opt/UCSF/Chimera64-2010-08-05/bin/python2.7 configure.py
<br>
# make<br>
# make install<br>
# cd ..
<br>
# wget
<a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-x11-gpl-4.7.4.tar.gz">http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-x11-gpl-4.7.4.tar.gz</a><br>
# tar zxvf PyQt-x11-gpl-4.7.4.tar.gz
<br>
# cd PyQt-x11-gpl-4.7.4
<br>
# update-alternatives --config qmake  #select qmake-qt4 option
<br>
# /opt/UCSF/Chimera64-2010-08-05/bin/python2.7 configure.py
--no-designer-plugin --qmake=/usr/bin/qmake-qt4
<br>
...<snip>...
<br>
The PyQt Python package will be installed in
<br>
/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages.
<br>
PyQt is being built with generated docstrings.
<br>
PyQt is being built with 'protected' redefined as 'public'.
<br>
The PyQt .sip files will be installed in
<br>
/opt/UCSF/Chimera64-2010-08-05/share/sip/PyQt4.
<br>
pyuic4, pyrcc4 and pylupdate4 will be installed in
<br>
/opt/UCSF/Chimera64-2010-08-05/bin.
<br>
...<snip>...
<br>
#make
<br>
#make install
<br>
<br>
That should satisfy the deps for spyder.  Then use easy_install to get
spyder installed, like so:
<br>
<br>
# /opt/UCSF/Chimera64-2010-08-05/bin/easy_install spyder
<br>
<br>
Then to run spyder with a chimera-like env, the following seems to
work:
<br>
<br>
# export CHIMERA=/opt/UCSF/Chimera64-2010-08-05
<br>
# export LD_LIBRARY_PATH="$CHIMERA/lib/"
<br>
# export TCL_LIBRARY="$CHIMERA/lib/tcl8.6"
<br>
# export TCLLIBPATH="{$CHIMERA/lib}"
<br>
# unset TK_LIBRARY
<br>
# unset TIX_LIBRARY
<br>
# export LD_PRELOAD=libotf.so
<br>
# export PATH=$PATH:$CHIMERA/bin
<br>
# unset PYTHONHOME
<br>
# unset PYTHONPATH
<br>
# $CHIMERA/bin/spyder
<br>
<br>
Within the spyder interactive console, it reports running python 2.7
and I see:
<br>
<br>
>>> import sys
<br>
>>> sys.path
<br>
['', '/opt/UCSF/Chimera64-2010-08-05/bin',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages/spyder-1.1.4-py2.7.egg',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages/pyflakes-0.4.0-py2.7.egg',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages/rope-0.9.3-py2.7.egg',
'/opt/UCSF/Chimera64-2010-08-05/lib/python27.zip',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/plat-linux2',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/lib-tk',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/lib-old',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/lib-dynload',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages',
'/opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages/PIL']
<br>
>>>
<br>
<br>
This is not quite the right path (and maybe LD_LIBRARY_PATH etc.), but
a few tweaks get it working, i.e.:
<br>
<br>
>>> sys.path.append('/opt/UCSF/Chimera64-2010-08-05/share')
<br>
>>> sys.path.append('/opt/UCSF/Chimera64-2010-08-05/lib')
<br>
>>> import chimera
<br>
>>> chimera.version.version
<br>
'alpha version 1.5 (build 31152) 2010-08-05 19:55:24 GMT'
<br>
<br>
This may not be a complete config/setup, but it's close.  The spyder
interface provides autocompletion, auto help-inspection, debug
facilities, workspace, etc.<br>
<br>
If anyone finds a better way to do this, please let me know.  There may
be better ways to do this with virtualenv, see<br>
<a class="moz-txt-link-freetext" href="http://clemesha.org/blog/2009/jul/05/modern-python-hacker-tools-virtualenv-fabric-pip/">http://clemesha.org/blog/2009/jul/05/modern-python-hacker-tools-virtualenv-fabric-pip/</a><br>
<br>
<br>
Best,
<br>
Darren
<br>
<br>
<br>
<pre class="moz-signature" cols="72">-- 

Darren L. Weber, Ph.D.
Programmer/Analyst on Chimera Development Team
Resource for Biocomputing, Visualization, and Informatics
Department of Pharmaceutical Chemistry
University of California, San Francisco
Mission Bay Campus (MC 2240), Genentech Hall (Room N453)
600 16th Street, San Francisco, CA 94158-2517 
dweber[at]cgl.ucsf.edu, 415-439-0619 (google voice)
<a class="moz-txt-link-freetext" href="http://www.cgl.ucsf.edu/chimera/">http://www.cgl.ucsf.edu/chimera/</a>

</pre>
</body>
</html>