<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div>Hi Mike,</div><div><br></div><div> Ok, so “set bgTransparency” is causing the error, because that code imports tkgui.py. To make an image with a transparent background Chimera requests a rendering framebuffer that remembers the transparency of every pixel. It is trying to tell the graphics window to switch to a framebuffer that has an alpha channel. This is a bit strange because Chimera image saving does not draw to the graphics window — instead it draws to an off-screen framebuffer, and it is that framebuffer that needs the alpha channel. With the “headless” Chimera it is always drawing to an off-screen framebuffer. I think this code would be simple to fix, but Chimera developer Greg Couch is the one who knows most about image saving and would be the one to do that. There is a complication that some ancient graphics doesn’t offer off-screen framebuffers and in Chimera in GUI mode the image saving does need to change the window framebuffer in order to have transparent background, so probably we can’t just eliminate that code, but maybe it just needs to not be called when in nogui mode. Greg will advise.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Tom</div><div><br></div><div><br></div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin: 0px;"><b>From: </b>Mike Sivley <br></div><div style="margin: 0px;"><b>Subject: </b><b>Re: [Chimera-users] [External] import error from module: Togl</b><br></div><div style="margin: 0px;"><b>Date: </b>July 25, 2014 at 10:32:21 AM PDT<br></div><div style="margin: 0px;"><b>To: </b>Tom Goddard <br></div><br><div>Thanks for the prompt reply, Tom. The script is called by another script, and so part of the traceback was getting lost. When I called it from the command-line I received the entire traceback. I've copied it at the bottom of this email, but while trying to reproduce the exception, I found the specific command which was causing issues: bgTransparency. I'm still not certain why this is suddenly causing an exception when previously it did not, but at least for my immediate purposes I can avoid the issue by sticking with a white background in the script and then manually setting the transparency from a Windows copy of chimera.<br><br>Any ideas as to why this particular command fails in linux/without the gui? Thanks for setting me on the right track!<br><br>> set bgTransparency<br>Traceback (most recent call last):<br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/ReadStdin/__init__.py", line 79, in _runCommand<br> chimera.runCommand(cmd)<br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/chimera/__init__.py", line 2663, in runCommand<br> makeCommand(*args, **kw)<br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/Midas/midas_text.py", line 69, in makeCommand<br> f(c, args)<br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/Midas/midas_text.py", line 2356, in doSet<br> cmd()<br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/Midas/__init__.py", line 2946, in setBgTransparency<br> printer.setTransparentBackground(True, updateGUI=True)<br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/chimera/printer.py", line 1030, in setTransparentBackground<br> from tkgui import app<br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/chimera/tkgui.py", line 73, in <module><br> import Togl<br>ImportError: No module named Togl<br><br>ImportError: No module named Togl<br><br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/chimera/tkgui.py", line 73, in <module><br> import Togl<br><br>Mike<br><br><br>On 7/25/2014 12:06 PM, Tom Goddard wrote:<br><blockquote type="cite">Hi Mike,<br><br> Chimera does not use your system Python nor does it use your system Python libraries normally. But maybe it is seeing those because you have an environment variable, maybe PYTHONPATH set. If you are running a bash shell on linux try the “set” command to list all the environment variables before running Chimera and see if anything specific to python appears.<br><br> Does chimera start without any command-line options?<br><br> You are right that it is strange that tkgui.py is being imported since that shouldn’t happen when using the —nogui flag. But possibly your script is calling some Chimera functionality that imports tkgui.py (even in nogui mode), hard to say without seeing your script. Also it would be much clearer if we had a full traceback showing all the function calls leading to the error — Python usually prints that, did it not give the full traceback in your case?<br><br><span class="Apple-tab-span" style="white-space: pre;"> </span>Tom<br><br><br>On Jul 25, 2014, at 9:28 AM, Mike Sivley wrote:<br><br><blockquote type="cite">I apologize in advance if this becomes too system-specific, as I believe an automatic update of our server's python libraries may be to blame for this error. However, my hope is that others may have run into the issue as well and have already found a solution.<br><br>I have a python/chimera script that generates Chimera scenes with various annotations assigned to residues in a protein structure. This script worked without issue for several weeks. I returned from a week of vacation and now the script fails with the following error:<br><br>ImportError: No module named Togl<br><br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/chimera/tkgui.py", line 73, in <module><br> import Togl<br><br>Togl appears to be a deprecated library, so my best guess is that it was removed during some automatic update (possibly of PyOpenGL?) applied to our servers. However, Chimera is distributed with its own python executable and libraries, so I'm unsure how this type of change could have affected it. I am using the nightly headless linux build of Chimera from 05-13-2014. I have reinstalled chimera from the original .bin file, and I have also installed the most recent nightly headless build. Neither resolved the issue. I'm additionally confused because the exception is raised by tkgui.py, which by naming convention seems like it shouldn't even be called given that I am passing the "--nogui --silent --script" parameters to chimera.<br><br>The specific call to chimera is this:<br><br>chimera --nogui --silent --script 'lib/PDBMapVisualize.py 1hho 1 maf temp/61098856282.TEMP 1.000000 0.000000 data/rcsb/biounit/coordinates/all/1hho.pdb1.gz results/pdbmap_1kg_1hho_20140725-11 -'<br><br>Where lib/PDBMapVisualize.py is my script and everything following are arguments to that script. Nothing about this call or the script it is calling have changed between when chimera ran successfully and now.<br><br>Any help or advice in resolving this issue would be greatly appreciated. Thanks!<br><br>Mike Sivley<br>PhD Student in Biomedical Informatics<br>Center for Human Genetics Research<br>Vanderbilt University Medical Center<br>_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users<br><br></blockquote></blockquote><br></div></blockquote><div>wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Mike,<br><br> Chimera does not use your system Python nor does it use your system Python libraries normally. But maybe it is seeing those because you have an environment variable, maybe PYTHONPATH set. If you are running a bash shell on linux try the “set” command to list all the environment variables before running Chimera and see if anything specific to python appears.<br><br> Does chimera start without any command-line options?<br><br> You are right that it is strange that tkgui.py is being imported since that shouldn’t happen when using the —nogui flag. But possibly your script is calling some Chimera functionality that imports tkgui.py (even in nogui mode), hard to say without seeing your script. Also it would be much clearer if we had a full traceback showing all the function calls leading to the error — Python usually prints that, did it not give the full traceback in your case?<br><br><span class="Apple-tab-span" style="white-space:pre"> </span>Tom<br><br><br>On Jul 25, 2014, at 9:28 AM, Mike Sivley wrote:<br><br><blockquote type="cite">I apologize in advance if this becomes too system-specific, as I believe an automatic update of our server's python libraries may be to blame for this error. However, my hope is that others may have run into the issue as well and have already found a solution.<br><br>I have a python/chimera script that generates Chimera scenes with various annotations assigned to residues in a protein structure. This script worked without issue for several weeks. I returned from a week of vacation and now the script fails with the following error:<br><br>ImportError: No module named Togl<br><br> File "/ant2/Bush_eQTL/sivleyrm/bin/UCSF-Chimera64-2014-05-13/share/chimera/tkgui.py", line 73, in <module><br> import Togl<br><br>Togl appears to be a deprecated library, so my best guess is that it was removed during some automatic update (possibly of PyOpenGL?) applied to our servers. However, Chimera is distributed with its own python executable and libraries, so I'm unsure how this type of change could have affected it. I am using the nightly headless linux build of Chimera from 05-13-2014. I have reinstalled chimera from the original .bin file, and I have also installed the most recent nightly headless build. Neither resolved the issue. I'm additionally confused because the exception is raised by tkgui.py, which by naming convention seems like it shouldn't even be called given that I am passing the "--nogui --silent --script" parameters to chimera.<br><br>The specific call to chimera is this:<br><br>chimera --nogui --silent --script 'lib/PDBMapVisualize.py 1hho 1 maf temp/61098856282.TEMP 1.000000 0.000000 data/rcsb/biounit/coordinates/all/1hho.pdb1.gz results/pdbmap_1kg_1hho_20140725-11 -'<br><br>Where lib/PDBMapVisualize.py is my script and everything following are arguments to that script. Nothing about this call or the script it is calling have changed between when chimera ran successfully and now.<br><br>Any help or advice in resolving this issue would be greatly appreciated. Thanks!<br><br>Mike Sivley<br>PhD Student in Biomedical Informatics<br>Center for Human Genetics Research<br>Vanderbilt University Medical Center<br>_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users<br><br></blockquote><br></blockquote></div><br></body></html>