<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 19, 2010, at 11:07 AM, Thomas Goddard wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">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.<br></span></blockquote><br></div><div>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:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>chimera --nogui myscript.py</div><div><br></div><div>will execute it (without bringing up the Chimera interface). See: </div><div><br></div><a href="http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/startup.html">Chimera Startup and Input</a><div><br></div><div><a href="http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/startup.html"></a>and:</div><div><br></div><div><a href="http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/options.html">System Command-Line Options</a></div><div><br></div><div>for more about running Chimera in this mode.</div><div><br></div><div>--Eric</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab</div><div><br></div></body></html>