Greg,<br>First, thank you very much for your help.<br>As your told me, it was a problem with environment variables.<br>Eclipse works now!! and it is easier than I thought. I'll try to explain the way I did it, but sorry about my bad english, I hope you understand what I say.
<br>1)Eclipse: Window (menu) > Preferences...<br> I seted Python interpreter: ...\chimera\bin\python.exe<br> Then I included chimera "share" directory in PYTHONPATH option.<br> Then choose apply and ok.
<br>2)Once I have created a new project, and a new python file or module was created:<br> Go to the Run As (menu option) clicking with right mouse button on the python module.<br> Then select Run ... option and select your file in the Python Run (subtree).
<br> Select Enviroment (tab) and mark option "Replace native environment with especified environment. I THINK THAT IS KEY STEP...<br> (Finally you could go to the Refresh tab and apply it to the entire workspace).<br>
<br>Well, I think it should works for everybody running Windows or Linux.<br><br>Thank you so much we keep in contact.<br><br>Javi.<br><br><br><div><span class="gmail_quote">On 10/2/06, <b class="gmail_sendername">Greg Couch
</b> <<a href="mailto:gregc@cgl.ucsf.edu">gregc@cgl.ucsf.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">We haven't used eclipse with chimera, but we will work with you to get it
<br>to work. When it does work, please send what you had to do back to the<br>chimera-dev list.<br><br>First an aside for non-eclipse users and maybe this would work in eclipse<br>too -- you can use Python's help facility to find out more about chimera
<br>internals: in an IDLE window, typing:<br><br> help(chimera.Point)<br><br>will give you a lot information about the Point API. Since Point is<br>implemented in C++, you only get the type information for the arguments
<br>and the return value, but that information, coupled with the name of the<br>method, tell you a lot.<br><br>Back to eclipse, the chimera program sets up several environment variables<br>before invoking python. On Linux, it is a shell script and you can see
<br>everything it does. On Windows, it's basically the same:<br><br> (1) set the CHIMERA environment variable to the actual path of the<br> chimera install tree (so without any symbolic links).<br> (2) make sure CHIMERA/bin is in the PATH environment
<br> (3) defensively remove the PYTHONHOME and PYTHONPATH environment<br> variables so we don't get packages compiled for a<br> different version of python (e.g, the system one)<br> (4) copy CHIMERPATH environment variable to the PYTHONPATH one
<br> (5) set Tcl environment variables:<br> TCL_LIBRARY is CHIMERA\lib\tcl8.4<br> TCLLIBPATH is {CHIMERA\lib}<br> (6) unset TK_LIBRARY and TIX_LIBRARY environment variables<br><br>
Unix systems replace step 2 with one that set the environment variable for<br>finding shared libaries, ie., LD_LIBRARY_PATH or DYLD_LIBRARY_PATH or ...<br>to CHIMERA/lib. On OS X, we also set the DYLD_FRAMEWORK_PATH.<br>
<br> Good luck,<br><br> Greg Couch<br> UCSF Computer Graphics Lab<br><br>On Mon, 2 Oct 2006, Javier Díez wrote:<br><br>> Date: Mon, 2 Oct 2006 20:38:53 +0200<br>> From: "[ISO-8859-1] Javier Díez" <
<a href="mailto:jdiezperezj@gmail.com">jdiezperezj@gmail.com</a>><br>> To: Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</a>><br>> Cc: <a href="mailto:chimera-dev@cgl.ucsf.edu">chimera-dev@cgl.ucsf.edu
</a><br>> Subject: Re: [chimera-dev] chimera import<br>><br>> Hi again,<br>> Thank you for your comments. From now I will never use the import<br>> construction I wrote above.<br>> But I have got another question.
<br>> Well, I'm using Eclipse and PyDev Extensions, and I seted the Eclipse Python<br>> interpreter option using the Python version included in Chimera.<br>> I also included the "share" in the Eclipse, PyDev PYTHONPATH, but it doesn't
<br>> works.<br>> I thought it could work, but it doesn't.<br>> I prefer Eclipse (because it is the enviroment I'm used to work with) to<br>> the IDLE provided by Chimera.<br>> Thank you any way.<br>> Javi
<br>><br>> On 10/2/06, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</a>> wrote:<br>>><br>>> Tom Goddard's comments are exactly correct, I just want to add some<br>>> advice. If anyone else will be working on your code, you should try to
<br>>> avoid the "from module_name import *" construct because it makes it more<br>>> difficult to find the place where a class is defined. Say for example you<br>>> use a Point object in your code. A person trying to find the definition
<br>>> for<br>>> Point first has to look through the file using Point to see if it's defined<br>>> there, then through each module from which you've imported "*" to look for<br>>> it. It is better to import just the names you are going to use, something
<br>>> like: "from chimera import Point, openModels, Molecule". That statement<br>>> makes it clear where the definition of Point is going to be found.<br>>> The other thing is that the "chimera" module imports all the names from
<br>>> _chimera, so typically you import from chimera rather than _chimera. I<br>>> know<br>>> that the chimera uses the "from _chimera import *" construct, which seems<br>>> somewhat hypocritical given the advice above, but it is being used to make
<br>>> C++ classes/functions that "logically" belong in the chimera module<br>>> available.<br>>><br>>> --Eric<br>>><br>>> Eric Pettersen<br>>><br>
>> UCSF Computer Graphics Lab<br>>><br>>> <a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</a><br>>><br>>> <a href="http://www.cgl.ucsf.edu">
http://www.cgl.ucsf.edu</a><br>>><br>>><br>>> On Oct 2, 2006, at 5:44 AM, Javier Díez wrote:<br>>><br>>> Hy,<br>>> I've just started working on a Chimera extension.<br>>> I've tried to import chimera after setting up the CHIMERA os variable, but
<br>>> it gives me this erro message:<br>>> ***from _chimera import *<br>>> ImportError: No module named _chimera<br>>> *Some help?<br>>> Thank you.<br>>> Javi<br>>> *<br>>> *
<br>>> _______________________________________________<br>>> Chimera-dev mailing list<br>>> <a href="mailto:Chimera-dev@cgl.ucsf.edu">Chimera-dev@cgl.ucsf.edu</a><br>>> <a href="http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev">
http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev</a><br>>><br>>><br>>><br>><br></blockquote></div><br>