On Apr 19, 2010, at 11:07 AM, Thomas Goddard wrote:

You cannot easily start Python and import Chimera.  There are a few reasons for this.  1) An environment variable needs to be set (LD_LIBRARY_PATH) so Chimera libraries can be found, 2) an environment variable (PYTHONPATH) needs to be set so Python can find Chimera modules, 3) Chimera requires exactly the Python binary that comes with it so that the dozens of compiled modules work correctly and unicode handling is done as expected.  Because of the difficulties we don't support importing Chimera in an already running Python -- but with work you could figure it out.

To supplement Tom's reply, therefore typically you let Chimera itself act as the Python interpreter.  For instance if you have a Python script contained in the file myscript.py, then:

chimera --nogui myscript.py

will execute it (without bringing up the Chimera interface).  See: 

Chimera Startup and Input

and:

System Command-Line Options

for more about running Chimera in this mode.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab