This list is closed, nobody may subscribe to it.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(10) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(3) |
Feb
(10) |
Mar
(5) |
Apr
(12) |
May
(8) |
Jun
(9) |
Jul
(3) |
Aug
(11) |
Sep
|
Oct
(26) |
Nov
(21) |
Dec
(20) |
2007 |
Jan
(10) |
Feb
(32) |
Mar
(14) |
Apr
(13) |
May
(44) |
Jun
(13) |
Jul
(18) |
Aug
(26) |
Sep
(17) |
Oct
(3) |
Nov
(10) |
Dec
(8) |
2008 |
Jan
(20) |
Feb
(8) |
Mar
(28) |
Apr
(18) |
May
(22) |
Jun
(13) |
Jul
(4) |
Aug
(2) |
Sep
(19) |
Oct
(17) |
Nov
(8) |
Dec
(10) |
2009 |
Jan
(4) |
Feb
(3) |
Mar
(12) |
Apr
(15) |
May
(7) |
Jun
(1) |
Jul
(13) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(14) |
Dec
(13) |
2010 |
Jan
(9) |
Feb
(6) |
Mar
(21) |
Apr
(12) |
May
(4) |
Jun
|
Jul
(2) |
Aug
(15) |
Sep
(3) |
Oct
(1) |
Nov
(18) |
Dec
(6) |
2011 |
Jan
(7) |
Feb
(13) |
Mar
(17) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(15) |
Aug
(11) |
Sep
(12) |
Oct
(3) |
Nov
(14) |
Dec
(4) |
2012 |
Jan
(10) |
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Adam T. <ate...@gm...> - 2007-10-28 17:55:06
|
Hi, I'm trying to distribute a Python project that depends on openbabel. I can get it to make a Mac app, but I can't figure out how to get the dynamic file format modules to work correctly. Does anyone know where these should be copied? I also created an openbabel installation where the file format modules are compiled into the main openbabel library, which does work with my Mac app. Unfortunately, it causes a 50 MB openbabel library to be included (univesal binary, so twice the size as normal). Is there a way to compile openbabel so that only a couple of supported formats are included instead of everything? I really only need XYZ, PDB, and MOL. Thanks, Adam |
From: Cankar M. <mat...@gm...> - 2007-10-18 20:13:45
|
Hello! I'm writing a script that takes a few connected atoms from one molecule and finds connected atoms (submolecule) in another molecule. The script first creates one-atom-submolecule. If this atom is a part of another molecule, than the script adds another atom to the submolecule. The added atom is connected to the first atom from the submolecule. Then the script tests if this bigger submolecule is part of another molecule. This continues until the submolecule is still a part of another molecule. I have a problem when I create a "submolecule". The structure of this part of script is: -> First, I take the atoms and the bonds that connect the atoms. -> Than I create the openBabel molecule from these atoms and bonds. If it nessesery, I set the atom's and the bond's aromatic flags. -> finally I use the findall() function from pybel to find the submolecule in another molecule If I take a submolecule from a molecule and I try to find it in this molecule afterwards, the script doesn’t find it. This problem occurs, when there are aromatic cycles. I made three different modifications to the code which makes the submolecule from the COP(=S)(OC)SCn1nnc2ccccc2c1=O: FIRST: Before the adding atoms to the molecule and after it I added beginModify() and endModify() functions. -> the atoms are written correctly (capital instead of small case letters) only if the aromatic cycle is closed: 0. N 1. NC 2. NCC 3. NCCC 4. NCC(C)C 5. NCC(CC)C 6. NCC(CC)CC 7. NCc1ccccc1 8. [N](Cc1ccccc1)[NH] 9. n1cc2c(cccc2)nn1 The submolecules from 0. to 8. are not written correctly but the ninth is. Also the findall() function finds the ninth submolecule in COP(=S)(OC)SCn1nnc2ccccc2c1=O. So when I close the aromatic cycle I get correctly written carbon and nitrous atoms. SECOND: Without the use of the beginModify() and endModify functions. -> that's not good, because the atoms are newer written correctly 1. N 2. NC 3. NCC 4. NCCC 5. NCC(C)C 6. NCC(CC)C 7. NCC(CC)CC 8. NCC1=CC=CC=C1 9. [N](CC1=CC=CC=C1)[NH] 10. N1=CC2=C(C=CC=C2)N=N1 11. [N]1(=CC2=C(C=CC=C2)N=N1)C THIRD: Every time when I add the atom in the submolecule I print out the submolecule. That's done by adding the pyMolecule = py.Molecule(mol) print pyMolecule.write() lines at the end of the loop which creates the submolecule. BeginModify() an EndModify() are not used -> the atoms are written correctly before the cycle is closed 1. N 2. nc 3. ncc 4. nccc 5. ncc(c)c 6. ncc(cc)c 7. ncc(cc)cc 8. ncc1ccccc1 9. [nH](cc1ccccc1)[n] 10. [nH]1cc2c(cccc2)[n][n]1 11. n1(cc2c(cccc2)[n][n]1)C 12. n1(cc2c(cccc2)[n][n]1)C[S] 13. n1(cc2c(cccc2)[n][n]1)C[S]P Problem is that submolecules 1., 8. and 9. are not written correctly. The findall() function does not find them in COP(=S)(OC)SCn1nnc2ccccc2c1=O. The others are OK. I'll would to have all the submolecules written correctly. Thank you for your help, Matic |
From: Matic C. <mat...@gm...> - 2007-09-18 12:46:48
|
> > > Now these are in random order, so the "begin" and the "end" are > relative terms. (We might have called them GetAtom1 and GetAtom2.) That's strange to me. I thought that bond shouldn't have a direction. For me is an endAtom always on the other side of the bond from the way I looked (from the atom that I called the method). If I am at one atom, on the end of the bond from this atom shouldn't be the same atom. Every bond has two atoms, but who decide which is at the beginning and which is at the end? Maybe I am wrong... That was the question in my head... > As Noel mentioned, if you're interested in iterating, you should look > at the various OB...Iter classes. Noel's answer was very helpful (is that what I need), but yours cleared my picture of OBbond (that I'll maybe need in the future). I hope that my questions don't spend a lot of your time. Matic |
From: Geoffrey H. <ge...@ge...> - 2007-09-18 12:08:46
|
Hi, > but I for the end atom from the first bond I get the specific atom > that I choose first (I get the atom that I'm processing not the end > atom). When I repaired the code so that I used "GetBeginAtom()" for > the first bond and, the "GetEndAtom()" for all others, I get the > correct answer. I see that Noel answered your question, but I wonder if this is a documentation issue. With Open Babel, a bond is a connection between two atoms -- the BeginAtom and the EndAtom. Now these are in random order, so the "begin" and the "end" are relative terms. (We might have called them GetAtom1 and GetAtom2.) Is this something that should be made clear in the documentation for OBBond? As Noel mentioned, if you're interested in iterating, you should look at the various OB...Iter classes. Cheers, -Geoff |
From: Noel O'B. <bao...@gm...> - 2007-09-18 11:49:13
|
vvInt is just a std::vector of std::vector of integers. Geoff, in Python I've got: %rename(__getitem__) *::operator[] This renames the C++ operator [] to the Python class method __getitem__, which allows Python users to access items using the [] notation (confusing, eh?). Maybe if you use the equivalent in Perl, something will happen... Noel On 17/09/2007, Duangrudee Tanramluk <DT...@ca...> wrote: > > > Dear Geoff, > > Thank you very much for your response. Also, a belated thank you to Noel and > Kieron. > > I have tried Data Dumper, but it gives an answer that I couldn't understand. > That is: > $VAR1 = bless( {}, 'Chemistry::OpenBabel::vvInt' ); > > My quick solution was to call Python function from the Perl code. Although, > it works fine, but I think there should be a better way. Any further > suggestion would be much appreciated. > > Cheers, > Duangrudee > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > |
From: Noel O'B. <bao...@gm...> - 2007-09-18 11:22:26
|
On 18/09/2007, Matic Cankar <mat...@gm...> wrote: > Thank you Noel for the answer. > I'll need information about the atoms and the bonds with which are they > connected to the "processed" atom. That's the reason why I chose that way of > programming. Ah, OK. So you want information on the bonds. > So if I understand you clear is better way that I use " > openbabel.OBAtomAtomIter" to get the atoms and then I get the bonds with > GetBond(OBAtom) like: Yes, this seems like the best way if you're interested in both the atoms and the bonds attached to a particular atom. However, if you're just interested in the bond orders of the bonds attached, you would just use openbabel.OBAtomBondIter(obatom) to iterate over the bonds attached to a particular atom. > ####### > import openbabel as ob > import pybel > > mol = pybel.readstring("smi", "COCC") > mol.OBMol.AddHydrogens() > > obatom = mol.atoms[0].OBAtom > for neighbour_atom in ob.OBAtomAtomIter(obatom): > print neighbour_atom.GetAtomicNum() > bond = obatom.GetBond(neighbour_atom) > print bond.GetBondOrder () > > ###### > Matic > > > > On 9/18/07, Noel O'Boyle <bao...@gm...> wrote: > > You can use openbabel.OBAtomAtomIter to iterate over the OBAtoms > > attached to an OBAtom. (I really should improve the documentation) You > > should familiarise yourself with all of the "Iter" methods in the OB > > API, as they are very useful for this type of problem: > > > > import openbabel as ob > > import pybel > > > > mol = pybel.readstring("smi", "COCC") > > mol.OBMol.AddHydrogens() > > > > obatom = mol.atoms[0].OBAtom > > for neighbour_atom in ob.OBAtomAtomIter(obatom): > > print neighbour_atom.GetAtomicNum() > > > > Result is: 8 1 1 1 > > > > (If you don't add hydrogens, you just get 8) > > > > Noel > > > > On 18/09/2007, Matic Cankar <mat...@gm...> wrote: > > > Hello, > > > > > > I have a question about bonds of the atom in the molecule. I would like > to > > > get all atoms, that are connected to one specific atom. > > > > > > I solved my problem this way (code is just symbolic, not actual code): > > > -> I make the bond iterator for the specific atom > > > > > > bonds = coreAtom.BeginBonds() > > > bond = coreAtom.BeginBond(bonds) > > > > > > -> and for each bond I use method "GetEndAtom()" > > > bond.GetEndAtom() > > > > > > but I for the end atom from the first bond I get the specific atom that > I > > > choose first (I get the atom that I'm processing not the end atom). When > I > > > repaired the code so that I used "GetBeginAtom()" for the first bond > and, > > > the "GetEndAtom()" for all others, I get the correct answer. > > > > > > The molecule is kind of graph and bonds are kind of edges. Are bonds > > > directed edges, and why so? > > > Will my corrected code worked in all conditions? Is first bond always > > > directed to the specified (processing atom in my code) atom and others > away > > > of the specified atom? > > > > > > thank you for your answer! > > > > > > Matic > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Microsoft > > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > _______________________________________________ > > > OpenBabel-scripting mailing list > > > Ope...@li... > > > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > > > > > > > > |
From: Matic C. <mat...@gm...> - 2007-09-18 11:03:17
|
Thank you Noel for the answer. I'll need information about the atoms and the bonds with which are they connected to the "processed" atom. That's the reason why I chose that way of programming. So if I understand you clear is better way that I use " openbabel.OBAtomAtomIter" to get the atoms and then I get the bonds with GetBond(OBAtom) like: ####### import openbabel as ob import pybel mol = pybel.readstring("smi", "COCC") mol.OBMol.AddHydrogens() obatom = mol.atoms[0].OBAtom for neighbour_atom in ob.OBAtomAtomIter(obatom): print neighbour_atom.GetAtomicNum() bond = obatom.GetBond(neighbour_atom) print bond.GetBondOrder() ###### Matic On 9/18/07, Noel O'Boyle <bao...@gm...> wrote: > > You can use openbabel.OBAtomAtomIter to iterate over the OBAtoms > attached to an OBAtom. (I really should improve the documentation) You > should familiarise yourself with all of the "Iter" methods in the OB > API, as they are very useful for this type of problem: > > import openbabel as ob > import pybel > > mol = pybel.readstring("smi", "COCC") > mol.OBMol.AddHydrogens() > > obatom = mol.atoms[0].OBAtom > for neighbour_atom in ob.OBAtomAtomIter(obatom): > print neighbour_atom.GetAtomicNum() > > Result is: 8 1 1 1 > > (If you don't add hydrogens, you just get 8) > > Noel > > On 18/09/2007, Matic Cankar <mat...@gm...> wrote: > > Hello, > > > > I have a question about bonds of the atom in the molecule. I would like > to > > get all atoms, that are connected to one specific atom. > > > > I solved my problem this way (code is just symbolic, not actual code): > > -> I make the bond iterator for the specific atom > > > > bonds = coreAtom.BeginBonds() > > bond = coreAtom.BeginBond(bonds) > > > > -> and for each bond I use method "GetEndAtom()" > > bond.GetEndAtom() > > > > but I for the end atom from the first bond I get the specific atom that > I > > choose first (I get the atom that I'm processing not the end atom). When > I > > repaired the code so that I used "GetBeginAtom()" for the first bond > and, > > the "GetEndAtom()" for all others, I get the correct answer. > > > > The molecule is kind of graph and bonds are kind of edges. Are bonds > > directed edges, and why so? > > Will my corrected code worked in all conditions? Is first bond always > > directed to the specified (processing atom in my code) atom and others > away > > of the specified atom? > > > > thank you for your answer! > > > > Matic > > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > OpenBabel-scripting mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > > > |
From: Noel O'B. <bao...@gm...> - 2007-09-18 10:21:17
|
You can use openbabel.OBAtomAtomIter to iterate over the OBAtoms attached to an OBAtom. (I really should improve the documentation) You should familiarise yourself with all of the "Iter" methods in the OB API, as they are very useful for this type of problem: import openbabel as ob import pybel mol = pybel.readstring("smi", "COCC") mol.OBMol.AddHydrogens() obatom = mol.atoms[0].OBAtom for neighbour_atom in ob.OBAtomAtomIter(obatom): print neighbour_atom.GetAtomicNum() Result is: 8 1 1 1 (If you don't add hydrogens, you just get 8) Noel On 18/09/2007, Matic Cankar <mat...@gm...> wrote: > Hello, > > I have a question about bonds of the atom in the molecule. I would like to > get all atoms, that are connected to one specific atom. > > I solved my problem this way (code is just symbolic, not actual code): > -> I make the bond iterator for the specific atom > > bonds = coreAtom.BeginBonds() > bond = coreAtom.BeginBond(bonds) > > -> and for each bond I use method "GetEndAtom()" > bond.GetEndAtom() > > but I for the end atom from the first bond I get the specific atom that I > choose first (I get the atom that I'm processing not the end atom). When I > repaired the code so that I used "GetBeginAtom()" for the first bond and, > the "GetEndAtom()" for all others, I get the correct answer. > > The molecule is kind of graph and bonds are kind of edges. Are bonds > directed edges, and why so? > Will my corrected code worked in all conditions? Is first bond always > directed to the specified (processing atom in my code) atom and others away > of the specified atom? > > thank you for your answer! > > Matic > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > |
From: Matic C. <mat...@gm...> - 2007-09-18 09:40:47
|
Hello, I have a question about bonds of the atom in the molecule. I would like to get all atoms, that are connected to one specific atom. I solved my problem this way (code is just symbolic, not actual code): -> I make the bond iterator for the specific atom bonds = coreAtom.BeginBonds() bond = coreAtom.BeginBond(bonds) -> and for each bond I use method "GetEndAtom()" bond.GetEndAtom() but I for the end atom from the first bond I get the specific atom that I choose first (I get the atom that I'm processing not the end atom). When I repaired the code so that I used "GetBeginAtom()" for the first bond and, the "GetEndAtom()" for all others, I get the correct answer. The molecule is kind of graph and bonds are kind of edges. Are bonds directed edges, and why so? Will my corrected code worked in all conditions? Is first bond always directed to the specified (processing atom in my code) atom and others away of the specified atom? thank you for your answer! Matic |
From: Duangrudee T. <DT...@ca...> - 2007-09-17 20:52:01
|
Dear Geoff, Thank you very much for your response. Also, a belated thank you to Noel = and Kieron.=20 I have tried Data Dumper, but it gives an answer that I couldn't = understand. That is: $VAR1 =3D bless( {}, 'Chemistry::OpenBabel::vvInt' ); My quick solution was to call Python function from the Perl code. = Although, it works fine, but I think there should be a better way. Any = further suggestion would be much appreciated. Cheers, Duangrudee |
From: Cankar M. <mat...@gm...> - 2007-09-17 15:59:01
|
Hi Noel and Jens, thank you for your answer. Sorry for my late answer. I still don't understand, why I have to specify the coordinates for the atoms? How the openbabel knows coordinates, if molecule is read from smiles? I'll do some programs and maybe I'll find out. I need this in my script with algorithm, where I read one molecule, and start search on it. During the search I collect some string of atoms which represents the part of a molecule. At the end I try to find this submolecul in other moleculs. (algorithm is similar to mofa) Have a nice day, Matic Jens Thomas pravi: > Hi Matic, > > There are a couple of problems with your code. Firstly, you haven't > specified any coordinates for the atoms and without this OpenBabel has > now way of knowing where to place the atoms. > > Secondly, you seem to be mixing up Pybel and OpenBabel. Pybel is a > python layer on top of the standard OpenBabel classes. A pybel > molecule does have a write method, but an standard OpenBabel one > doesn't - to do this with the standard OpenBabel classes, you'll need > to use an OBConversion object. > > If you want to use pybel, you'll have to explicitly create a pybel > molecule. > > I've attached some amended code that I hope will help you. > > > Best wishes, > > Jens > > # Use import as it makes it easier to > # see what's coming from where > import openbabel > import pybel > > > # Create the molecules and atoms > mol = openbabel.OBMol() > atom = openbabel.OBAtom() > atom2= openbabel.OBAtom() > > atom.SetAtomicNum(6) > atom2.SetAtomicNum(7) > > # Specify the coordinates for the atoms > atom.SetVector( 0.0,0.0,0.0 ) > atom2.SetVector( 1.46,0.0,0.0 ) > > mol.BeginModify() > okAtom = mol.AddAtom(atom) > okAtom2 = mol.AddAtom(atom2) > > okBond =mol.AddBond(1,2,1) > > mol.EndModify() > > print okAtom, okAtom2, okBond > > atom3=mol.GetAtom(1) > print atom3.GetAtomicNum() > atom3=mol.GetAtom(2) > print atom3.GetAtomicNum() > > mol.AddHydrogens() > > # Can use the dir method to get a list of methods of an > # object and you'll see that there is no write method > #print dir(mol) > > # Make a pybel molecule - this does have a write method > mol = pybel.Molecule(OBMol=mol) > > # By default, just returns a string > print mol.write() > > # Now write to a file in xyz format > mol.write( format="xyz",filename="test.xyz" ) > > > Matic Cankar wrote: >> Hello! >> >> I'm working on some script in python (I'm very new with it). I would >> like to build new molecule with OBmol and print it. Is that posible? >> >> my code is: >> from openbabel import * >> >> from pybel import * >> >> >> mol = OBMol() >> atom = OBAtom() >> atom2= OBAtom() >> atom.SetAtomicNum(6) >> atom2.SetAtomicNum(7) >> >> mol.BeginModify() >> okAtom = mol.AddAtom(atom) >> okAtom2 = mol.AddAtom(atom2) >> >> okBond =mol.AddBond(1,2,1) >> >> mol.EndModify() >> >> print okAtom, okAtom2, okBond >> >> atom3=mol.GetAtom(1) >> print atom3.GetAtomicNum() >> atom3=mol.GetAtom(2) >> print atom3.GetAtomicNum() >> >> mol.AddHydrogens >> () >> >> >> >> print(mol.write >> ()) >> >> >> Code works perfectly until the last line. What am I doing wrong? >> >> Thank you for your answer, >> >> Matic >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2005. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> OpenBabel-scripting mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> > > |
From: Geoffrey H. <ge...@ge...> - 2007-09-14 20:37:15
|
First off, I'm very sorry for the *extremely* late reply. I've been completely buried with past messages and Noel reminded me. On Jul 31, 2007, at 7:15 PM, Duangrudee Tanramluk wrote: > I guess the next step should be: > > my $maplist = $obsmartpattern->GetUMapList(); > > However, I have no success in iterating through the maplist to > print out which atoms match the SMARTS by using Perl. Any > suggestion of how to print out the atoms would be greatly appreciated. Honestly, when I have questions about types in Perl, I use Data::Dumper: http://search.cpan.org/~jhi/perl-5.8.0/ext/Data/Dumper/Dumper.pm So if it's unclear what the format of $maplist is, do something like this: use Data::Dumper; print Dumper($maplist); Then you see what you get! Its entirely possible that we need to do some SWIG magic to get a better list/array for Perl here. I admit I haven't tried SMARTS maps with Perl yet. Cheers, -Geoff |
From: Geoffrey H. <ge...@ge...> - 2007-09-14 20:26:30
|
> I've just installed openbabel-2.1.1 from source without incident > (though make and configure outputs are attached), and when I then > create the perl makefile and run make, I also experience no > errors). However, when I run 'make test', the conversion test fails: > > Failed 3/9 tests, 66.67% okay > $obConversion->ReadString($obMol,"C1=CC=CS1"); > is failing silently as it creates an empty $obMol object, with no > atoms. Also, the line: > appears to be failing silently as no file is created. Hi David, Sorry for the *extremely* long wait for a reply. I'm trying to get back and address all the messages waiting for me over the last few months. I have no idea why these tests are failing in Perl -- the same tests are run in C++ and work. (Actually, the C++ test suite was partly ported from the small Perl test suite, including the use of "prove.") I've filed this as a bug: http://sourceforge.net/tracker/index.php? func=detail&aid=1795155&group_id=40728&atid=428740 Cheers, -Geoff |
From: Noel O'B. <bao...@gm...> - 2007-09-14 11:28:52
|
I've just realised that my own reply went to openbabel-discuss instead of openbabel-scripting! For the record, here it is... ---------- Forwarded message ---------- From: Noel O'Boyle <bao...@gm...> Date: 11 Sep 2007 09:28 Subject: Re: [Open Babel] OBmol in Python To: Matic Cankar <mat...@gm...> Cc: ope...@li... Hello Matic, > I'm working on some script in python (I'm very new with it). I would like to > build new molecule with OBmol and print it. Is that posible? > > my code is: > from openbabel import * > > from pybel import * > > > mol = OBMol() > atom = OBAtom() > atom2= OBAtom() > atom.SetAtomicNum(6) > atom2.SetAtomicNum(7) > > mol.BeginModify() > okAtom = mol.AddAtom(atom) > okAtom2 = mol.AddAtom(atom2) > > okBond =mol.AddBond(1,2,1) > > mol.EndModify() > > print okAtom, okAtom2, okBond > > atom3=mol.GetAtom(1) > print atom3.GetAtomicNum() > atom3=mol.GetAtom(2) > print atom3.GetAtomicNum() > > mol.AddHydrogens() > > > > print(mol.write()) > > > > Code works perfectly until the last line. What am I doing wrong? OBMol does not have a write() method. To write molecules you need to create an OBConversion object, as shown in the OBMol documentation: http://openbabel.sourceforge.net/api/2.1.0/classOpenBabel_1_1OBMol.shtml#_details or as shown on the OpenBabel Python page: http://openbabel.sourceforge.net/wiki/Python#Examples An alternative way is to create a Pybel Molecule, which makes this easier: pymol = Molecule(mol) # This is a pybel.Molecule print pymol.write("can") # Writes a canonical SMILES string The documentation describing this is at: http://openbabel.sourceforge.net/wiki/Python#Input.2FOutput > Thank you for your answer. No problemo, Noel > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > OpenBabel-discuss mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > > |
From: Jens T. <j.m...@dl...> - 2007-09-14 11:25:21
|
Hi Matic, There are a couple of problems with your code. Firstly, you haven't specified any coordinates for the atoms and without this OpenBabel has now way of knowing where to place the atoms. Secondly, you seem to be mixing up Pybel and OpenBabel. Pybel is a python layer on top of the standard OpenBabel classes. A pybel molecule does have a write method, but an standard OpenBabel one doesn't - to do this with the standard OpenBabel classes, you'll need to use an OBConversion object. If you want to use pybel, you'll have to explicitly create a pybel molecule. I've attached some amended code that I hope will help you. Best wishes, Jens # Use import as it makes it easier to # see what's coming from where import openbabel import pybel # Create the molecules and atoms mol = openbabel.OBMol() atom = openbabel.OBAtom() atom2= openbabel.OBAtom() atom.SetAtomicNum(6) atom2.SetAtomicNum(7) # Specify the coordinates for the atoms atom.SetVector( 0.0,0.0,0.0 ) atom2.SetVector( 1.46,0.0,0.0 ) mol.BeginModify() okAtom = mol.AddAtom(atom) okAtom2 = mol.AddAtom(atom2) okBond =mol.AddBond(1,2,1) mol.EndModify() print okAtom, okAtom2, okBond atom3=mol.GetAtom(1) print atom3.GetAtomicNum() atom3=mol.GetAtom(2) print atom3.GetAtomicNum() mol.AddHydrogens() # Can use the dir method to get a list of methods of an # object and you'll see that there is no write method #print dir(mol) # Make a pybel molecule - this does have a write method mol = pybel.Molecule(OBMol=mol) # By default, just returns a string print mol.write() # Now write to a file in xyz format mol.write( format="xyz",filename="test.xyz" ) Matic Cankar wrote: > Hello! > > I'm working on some script in python (I'm very new with it). I would > like to build new molecule with OBmol and print it. Is that posible? > > my code is: > from openbabel import * > > from pybel import * > > > mol = OBMol() > atom = OBAtom() > atom2= OBAtom() > atom.SetAtomicNum(6) > atom2.SetAtomicNum(7) > > mol.BeginModify() > okAtom = mol.AddAtom(atom) > okAtom2 = mol.AddAtom(atom2) > > okBond =mol.AddBond(1,2,1) > > mol.EndModify() > > print okAtom, okAtom2, okBond > > atom3=mol.GetAtom(1) > print atom3.GetAtomicNum() > atom3=mol.GetAtom(2) > print atom3.GetAtomicNum() > > mol.AddHydrogens > () > > > > print(mol.write > ()) > > > > Code works perfectly until the last line. What am I doing wrong? > > Thank you for your answer, > > Matic > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > ------------------------------------------------------------------------ > > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > -- =================================================================== Jens Thomas, email: j.m...@dl... STFC Daresbury Lab, tel: +44-1925-603849 Warrington, fax: +44-1925-603634 WA4 4AD, UK. http: http://www.cse.scitech.ac.uk =================================================================== |
From: Matic C. <mat...@gm...> - 2007-09-10 17:32:02
|
Hello! I'm working on some script in python (I'm very new with it). I would like to build new molecule with OBmol and print it. Is that posible? my code is: from openbabel import * from pybel import * mol = OBMol() atom = OBAtom() atom2= OBAtom() atom.SetAtomicNum(6) atom2.SetAtomicNum(7) mol.BeginModify() okAtom = mol.AddAtom(atom) okAtom2 = mol.AddAtom(atom2) okBond =mol.AddBond(1,2,1) mol.EndModify() print okAtom, okAtom2, okBond atom3=mol.GetAtom(1) print atom3.GetAtomicNum() atom3=mol.GetAtom(2) print atom3.GetAtomicNum() mol.AddHydrogens() print(mol.write ()) Code works perfectly until the last line. What am I doing wrong? Thank you for your answer, Matic |
From: Noel O'B. <bao...@gm...> - 2007-09-04 15:39:33
|
QWgsIEkgc2VlLiBUaGF0J3MgYSBnb29kIHBvaW50LiBUbyB0cmFuc2xhdGUgdGhlIEMrKyBleGFt cGxlcyBpbiB0aGUKQVBJIGRvY3VtZW50YXRpb24gaW50byBvdGhlciBsYW5ndWFnZXMuIFdlIHdp bGwgdGhpbmsgYWJvdXQgdGhpcyA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Bjb3Vyc2UgSSBrbm93IGl0J3MgYSBsYWJvcmlvdXMg d29yaywNCmJ1dCBJIGd1ZXNzIGl0IHdvcnRocy4NCg0KcmVnYXJkcw0KDQo9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09DQrWo8u81LYNClNpeXVhbiBaaGVuZywgUGhEIHN0dWRlbnQN CmJpb2luZm9ybWF0aWNzIGNlbnRlciwgS2V5IExhYiBvZiBTeXN0ZW1zIEJpb2xvZ3ksIFNJQlMs IENBUw0KU2hhbmdoYWkgSW5zdGl0dXRlcyBmb3IgQmlvbG9naWNhbCBTY2llbmNlcyhTSUJTKQ0K Q2hpbmVzZSBBY2FkZW15IG9mIFNjaWVuY2VzIChDQVMpDQpTaGFuZ2hhaSwgQ2hpbmEgDQpFbWFp bDogc3l6aGVuZ0BzaWJzLmFjLmNuDQpUZWxlcGhvbmU6IDg2LTIxLTU0OTIwMDc5DQpBZGRyZXNz OiAzMjAgWXVleWFuZyBSb2FkLFNoYW5naGFpLENoaW5hDQpXZWI6IHd3dy5iaW9zaW5vLm9yZyAN Cg== |
From: Geoffrey H. <ge...@ge...> - 2007-08-28 17:15:44
|
> Is that correct? I ask as I'd like to recommend a simple way for our > Macintosh and Linux users to get the Python bindings installed. Well, I can provide Mac packages for Python. The problem is similar to Linux packages -- which version of Python? And where? Some people (myself included), also have Mac Ports and/or Fink with installed Python. But the scripting interfaces clearly have enough interest (and are stable enough) that it's worthwhile doing this. > PS - a slightly off-topic question. I tried to remove openbabel > from my > Mac so I could see what the installer provided. I think the README with the installer spells out what it installs -- the core libraries and binaries to /usr/local. If you'd like me to include a manifest, I can. The Mac Installer.app can be run to generate a list of installed files. Cheers, -Geoff |
From: Noel O'B. <bao...@gm...> - 2007-08-28 13:01:43
|
Your suggestion has the advantage of conserving disk space. However... (1) It would tie releases of OBPython to OBWin which is what I (at least) am trying to avoid. (2) Bug reports will be complicated and difficult to solve where the user has installed several different version of OBabel. The problem is that the Python extension looks for DLLs first in the directory where it is installed, and then it looks on the Windows PATH. As you can imagine, there could be all sorts of stuff on the PATH. So, to make life easier for everyone (especially me :-) ), I chose to bundle everything within the Python installer. This avoids all conflicts, at the expense of some duplication of disk space. Whether something similar can (or indeed should) be done for Linux is a more difficult question. Noel On 28/08/07, Felix Plasser <fel...@gm...> wrote: > ok that sounds good. > > if you want another suggestion: I think it would be good to have the opti= on > to just download the python packages without any dlls. most people that g= et > openbabel/python probably already have openbabel. and then they would not > want to download everything else. > > Felix > > -----Urspr=FCngliche Nachricht----- > Von: Noel O'Boyle [mailto:bao...@gm...] > Gesendet: Dienstag, 28. August 2007 10:37 > An: Felix Plasser > Cc: openbabel-scripting > Betreff: Re: [Open Babel] Open Babel in Python > > I've released a new version of OB/Python/Windows (1.2.2) which now > includes iconv.dll. > > On my computer iconv.dll was available on the path in another package > (even without OpenBabel/Win installed) so that I wasn't aware of this > problem. > > Hopefully this means that the Windows Python extension module can now > be installed independently of the command-line/GUI clients. > > Noel > > On 26/08/07, Noel O'Boyle <bao...@gm...> wrote: > > On 26/08/07, Felix Plasser <fel...@gm...> wrote: > > > hi, > > > the problem was that the file iconf.dll is not contained in the > openbabel > > > for python distribution. > > Oh, oh - sorry about that. I should have tested this better. > > > > > what I did is changing the BABELDATA_DIR to the > > > folder where the regular openbabel was already installed. then I cou= ld > also > > > erase all the .dll files and the openbabel_data folder and it still > works > > > and I like it. > > > > > > it may be a good idea if one could just download the python packages = and > > > would not have to download everything else again. > > > > Sure - this is what we want to do. I will try to reproduce this > > problem and fix it. > > > > > Felix > > > > > > -----Urspr=FCngliche Nachricht----- > > > Von: Noel O'Boyle [mailto:bao...@gm...] > > > Gesendet: Samstag, 25. August 2007 19:40 > > > An: Felix Plasser > > > Cc: ope...@li... > > > Betreff: Re: [Open Babel] Open Babel in Python > > > > > > (I've moved this thread to openbabel-scripting instead) > > > > > > On 24/08/07, Felix Plasser <fel...@gm...> wrote: > > > > I installed the Open Babel for Python 2.5 > > > > (openbabel-python-1.2.1.py2.5.exe) on my Windows XP > > > > Professional machine. > > > > > > > > My problem is that there is an error when I try "import openbabel": > > > > > > > > the module _openbabel is not found. when I check the folder, there > really > > > is > > > > no _openbabel file there. the only file like it is _openbabel.pyd > (which > > > is > > > > not a Python file). > > > > > > On my computer, in C:\Program Files\Python2.5\Lib\site-packages I hav= e: > > > OpenBabelDLL.dll, _openbabel.pyd, and openbabel.py. > > > > > > The most common problem is a mix up between different versions of the > > > installed python. Can you make sure that: (a) you have Python2.5 > > > installed, (b) that you have installed the Python 2.5 version of OB > > > (which you seem to have done), and (c) that you are running this > > > particular version when you are typing "import openbabel". You may > > > find it helpful to use "python -v" when starting python, and > > > doublecheck all the paths. > > > > > > It really should work first time, so let us know if there is still a > > > problem. > > > > > > Noel > > > > > > > > > > > > ------- > > > > > > > > Felix Plasser > > > > > > > > fel...@gm... > > > > > > > > www.chemical-quantum-images.blogspot.com > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. > > > > Still grepping through log files to find problems? Stop. > > > > Now Search log events and configuration files using AJAX and a > browser. > > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > > _______________________________________________ > > > > OpenBabel-discuss mailing list > > > > Ope...@li... > > > > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > > > > > > > > > > > > > > > > > > |
From: Noel O'B. <bao...@gm...> - 2007-08-28 10:23:13
|
On 28/08/07, Jens Thomas <j.m...@dl...> wrote: > Hi Noel, > > Great to hear about the new version of OpenBabel for Python on Windows. > I look forward to trying it out. > > Do you know what the situation is as regards the Python bindings on > other platforms? My current understanding is that for almost all *nix > platforms, the only way to get the Python bindings on is to build > OpenBabel from source and run the setup.py script from the > scripts/python directory. This is the canonical way. > I can find an openbabel-python rpm for Fedora but that seems to be it. > It also seems that the Macintosh installer only installs the base stuff > and not the scripting extensions. Some users volunteer to package openbabel and openbabel-python for various Linux distributions. At our end ("upstream") we don't do this. After all, there are many different Linux distributions each with different policies. Debian and Ubuntu are looked after by Michael Banck...google "debichem". As far as I know, Python bindings will be in the next Ubuntu release (which presumably means they're not already in Debian). Perhaps it possible to already use the prepared .deb files. For other Linux distributions it is impossible to find out without going to each distributions web page. Unfortunately, the downstream maintainers don't communicate with us (except when there's a problem at our end) so we don't have any information on this. It would be nice if they kept a status update on our wiki...maybe we'll try to start this. I've just come from the Fedora web site, but I wasn't able to find a list of packages! How annoying is that? > Is that correct? I ask as I'd like to recommend a simple way for our > Macintosh and Linux users to get the Python bindings installed. I don't know anything about Macs. Speaking on my own behalf, it might be a good idea to create an Autopackage or Zero Install (http://0install.net/) or something else to make it easy to install. > PS - a slightly off-topic question. I tried to remove openbabel from my > Mac so I could see what the installer provided. Conveniently, the main > OpenBabel Makefile has an uninstall target that removes OpenBabel, but I > couldn't work out how to uninstall the Python stuff short of going into > the site packages directory and manually deleting everything. Is anyone > aware of a more graceful way of doing this? Except on Windows, there is no uninstall for Python packages in general, at least using distutils. If you want to see what the installer provides, perhaps you could install into different directory in your HOME. We want to make the install process as easy as possible for users, so keep kicking us, but this is a general problem for distributing code on Linux. I will look into Autopackage and its cousins. Noel > Noel O'Boyle wrote: > > I've released a new version of OB/Python/Windows (1.2.2) which now > > includes iconv.dll. > > > > On my computer iconv.dll was available on the path in another package > > (even without OpenBabel/Win installed) so that I wasn't aware of this > > problem. > > > > Hopefully this means that the Windows Python extension module can now > > be installed independently of the command-line/GUI clients. > > > > Noel > > > > On 26/08/07, Noel O'Boyle <bao...@gm...> wrote: > > > >> On 26/08/07, Felix Plasser <fel...@gm...> wrote: > >> > >>> hi, > >>> the problem was that the file iconf.dll is not contained in the openb= abel > >>> for python distribution. > >>> > >> Oh, oh - sorry about that. I should have tested this better. > >> > >> > >>> what I did is changing the BABELDATA_DIR to the > >>> folder where the regular openbabel was already installed. then I cou= ld also > >>> erase all the .dll files and the openbabel_data folder and it still w= orks > >>> and I like it. > >>> > >>> it may be a good idea if one could just download the python packages = and > >>> would not have to download everything else again. > >>> > >> Sure - this is what we want to do. I will try to reproduce this > >> problem and fix it. > >> > >> > >>> Felix > >>> > >>> -----Urspr=FCngliche Nachricht----- > >>> Von: Noel O'Boyle [mailto:bao...@gm...] > >>> Gesendet: Samstag, 25. August 2007 19:40 > >>> An: Felix Plasser > >>> Cc: ope...@li... > >>> Betreff: Re: [Open Babel] Open Babel in Python > >>> > >>> (I've moved this thread to openbabel-scripting instead) > >>> > >>> On 24/08/07, Felix Plasser <fel...@gm...> wrote: > >>> > >>>> I installed the Open Babel for Python 2.5 > >>>> (openbabel-python-1.2.1.py2.5.exe) on my Windows XP > >>>> Professional machine. > >>>> > >>>> My problem is that there is an error when I try "import openbabel": > >>>> > >>>> the module _openbabel is not found. when I check the folder, there r= eally > >>>> > >>> is > >>> > >>>> no _openbabel file there. the only file like it is _openbabel.pyd (w= hich > >>>> > >>> is > >>> > >>>> not a Python file). > >>>> > >>> On my computer, in C:\Program Files\Python2.5\Lib\site-packages I hav= e: > >>> OpenBabelDLL.dll, _openbabel.pyd, and openbabel.py. > >>> > >>> The most common problem is a mix up between different versions of the > >>> installed python. Can you make sure that: (a) you have Python2.5 > >>> installed, (b) that you have installed the Python 2.5 version of OB > >>> (which you seem to have done), and (c) that you are running this > >>> particular version when you are typing "import openbabel". You may > >>> find it helpful to use "python -v" when starting python, and > >>> doublecheck all the paths. > >>> > >>> It really should work first time, so let us know if there is still a > >>> problem. > >>> > >>> Noel > >>> > >>>> ------- > >>>> > >>>> Felix Plasser > >>>> > >>>> fel...@gm... > >>>> > >>>> www.chemical-quantum-images.blogspot.com > >>>> > >>>> > >>>> --------------------------------------------------------------------= ----- > >>>> This SF.net email is sponsored by: Splunk Inc. > >>>> Still grepping through log files to find problems? Stop. > >>>> Now Search log events and configuration files using AJAX and a brows= er. > >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ > >>>> _______________________________________________ > >>>> OpenBabel-discuss mailing list > >>>> Ope...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > >>>> > >>>> > >>>> > >>> > > > > -----------------------------------------------------------------------= -- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > OpenBabel-scripting mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > > > > > > > -- > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Jens Thomas, email: j.m...@dl... > STFC Daresbury Lab, tel: +44-1925-603849 > Warrington, fax: +44-1925-603634 > WA4 4AD, UK. http: http://www.cse.scitech.ac.uk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > |
From: Jens T. <j.m...@dl...> - 2007-08-28 09:48:29
|
Hi Noel, Great to hear about the new version of OpenBabel for Python on Windows. I look forward to trying it out. Do you know what the situation is as regards the Python bindings on other platforms? My current understanding is that for almost all *nix platforms, the only way to get the Python bindings on is to build OpenBabel from source and run the setup.py script from the scripts/python directory. I can find an openbabel-python rpm for Fedora but that seems to be it. It also seems that the Macintosh installer only installs the base stuff and not the scripting extensions. Is that correct? I ask as I'd like to recommend a simple way for our Macintosh and Linux users to get the Python bindings installed. Best wishes, Jens PS - a slightly off-topic question. I tried to remove openbabel from my Mac so I could see what the installer provided. Conveniently, the main OpenBabel Makefile has an uninstall target that removes OpenBabel, but I couldn't work out how to uninstall the Python stuff short of going into the site packages directory and manually deleting everything. Is anyone aware of a more graceful way of doing this? Noel O'Boyle wrote: > I've released a new version of OB/Python/Windows (1.2.2) which now > includes iconv.dll. > > On my computer iconv.dll was available on the path in another package > (even without OpenBabel/Win installed) so that I wasn't aware of this > problem. > > Hopefully this means that the Windows Python extension module can now > be installed independently of the command-line/GUI clients. > > Noel > > On 26/08/07, Noel O'Boyle <bao...@gm...> wrote: > >> On 26/08/07, Felix Plasser <fel...@gm...> wrote: >> >>> hi, >>> the problem was that the file iconf.dll is not contained in the openbabel >>> for python distribution. >>> >> Oh, oh - sorry about that. I should have tested this better. >> >> >>> what I did is changing the BABELDATA_DIR to the >>> folder where the regular openbabel was already installed. then I could also >>> erase all the .dll files and the openbabel_data folder and it still works >>> and I like it. >>> >>> it may be a good idea if one could just download the python packages and >>> would not have to download everything else again. >>> >> Sure - this is what we want to do. I will try to reproduce this >> problem and fix it. >> >> >>> Felix >>> >>> -----Ursprüngliche Nachricht----- >>> Von: Noel O'Boyle [mailto:bao...@gm...] >>> Gesendet: Samstag, 25. August 2007 19:40 >>> An: Felix Plasser >>> Cc: ope...@li... >>> Betreff: Re: [Open Babel] Open Babel in Python >>> >>> (I've moved this thread to openbabel-scripting instead) >>> >>> On 24/08/07, Felix Plasser <fel...@gm...> wrote: >>> >>>> I installed the Open Babel for Python 2.5 >>>> (openbabel-python-1.2.1.py2.5.exe) on my Windows XP >>>> Professional machine. >>>> >>>> My problem is that there is an error when I try "import openbabel": >>>> >>>> the module _openbabel is not found. when I check the folder, there really >>>> >>> is >>> >>>> no _openbabel file there. the only file like it is _openbabel.pyd (which >>>> >>> is >>> >>>> not a Python file). >>>> >>> On my computer, in C:\Program Files\Python2.5\Lib\site-packages I have: >>> OpenBabelDLL.dll, _openbabel.pyd, and openbabel.py. >>> >>> The most common problem is a mix up between different versions of the >>> installed python. Can you make sure that: (a) you have Python2.5 >>> installed, (b) that you have installed the Python 2.5 version of OB >>> (which you seem to have done), and (c) that you are running this >>> particular version when you are typing "import openbabel". You may >>> find it helpful to use "python -v" when starting python, and >>> doublecheck all the paths. >>> >>> It really should work first time, so let us know if there is still a >>> problem. >>> >>> Noel >>> >>>> ------- >>>> >>>> Felix Plasser >>>> >>>> fel...@gm... >>>> >>>> www.chemical-quantum-images.blogspot.com >>>> >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by: Splunk Inc. >>>> Still grepping through log files to find problems? Stop. >>>> Now Search log events and configuration files using AJAX and a browser. >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>>> _______________________________________________ >>>> OpenBabel-discuss mailing list >>>> Ope...@li... >>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss >>>> >>>> >>>> >>> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > -- =================================================================== Jens Thomas, email: j.m...@dl... STFC Daresbury Lab, tel: +44-1925-603849 Warrington, fax: +44-1925-603634 WA4 4AD, UK. http: http://www.cse.scitech.ac.uk =================================================================== |
From: Noel O'B. <bao...@gm...> - 2007-08-28 08:36:40
|
I've released a new version of OB/Python/Windows (1.2.2) which now includes iconv.dll. On my computer iconv.dll was available on the path in another package (even without OpenBabel/Win installed) so that I wasn't aware of this problem. Hopefully this means that the Windows Python extension module can now be installed independently of the command-line/GUI clients. Noel On 26/08/07, Noel O'Boyle <bao...@gm...> wrote: > On 26/08/07, Felix Plasser <fel...@gm...> wrote: > > hi, > > the problem was that the file iconf.dll is not contained in the openbab= el > > for python distribution. > Oh, oh - sorry about that. I should have tested this better. > > > what I did is changing the BABELDATA_DIR to the > > folder where the regular openbabel was already installed. then I could= also > > erase all the .dll files and the openbabel_data folder and it still wor= ks > > and I like it. > > > > it may be a good idea if one could just download the python packages an= d > > would not have to download everything else again. > > Sure - this is what we want to do. I will try to reproduce this > problem and fix it. > > > Felix > > > > -----Urspr=FCngliche Nachricht----- > > Von: Noel O'Boyle [mailto:bao...@gm...] > > Gesendet: Samstag, 25. August 2007 19:40 > > An: Felix Plasser > > Cc: ope...@li... > > Betreff: Re: [Open Babel] Open Babel in Python > > > > (I've moved this thread to openbabel-scripting instead) > > > > On 24/08/07, Felix Plasser <fel...@gm...> wrote: > > > I installed the Open Babel for Python 2.5 > > > (openbabel-python-1.2.1.py2.5.exe) on my Windows XP > > > Professional machine. > > > > > > My problem is that there is an error when I try "import openbabel": > > > > > > the module _openbabel is not found. when I check the folder, there re= ally > > is > > > no _openbabel file there. the only file like it is _openbabel.pyd (wh= ich > > is > > > not a Python file). > > > > On my computer, in C:\Program Files\Python2.5\Lib\site-packages I have: > > OpenBabelDLL.dll, _openbabel.pyd, and openbabel.py. > > > > The most common problem is a mix up between different versions of the > > installed python. Can you make sure that: (a) you have Python2.5 > > installed, (b) that you have installed the Python 2.5 version of OB > > (which you seem to have done), and (c) that you are running this > > particular version when you are typing "import openbabel". You may > > find it helpful to use "python -v" when starting python, and > > doublecheck all the paths. > > > > It really should work first time, so let us know if there is still a > > problem. > > > > Noel > > > > > > > > > ------- > > > > > > Felix Plasser > > > > > > fel...@gm... > > > > > > www.chemical-quantum-images.blogspot.com > > > > > > > > > ---------------------------------------------------------------------= ---- > > > This SF.net email is sponsored by: Splunk Inc. > > > Still grepping through log files to find problems? Stop. > > > Now Search log events and configuration files using AJAX and a browse= r. > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > _______________________________________________ > > > OpenBabel-discuss mailing list > > > Ope...@li... > > > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > > > > > > > > > > > |
From: Noel O'B. <bao...@gm...> - 2007-08-27 16:31:02
|
First of all, this shouldn't happen so there must be some problem with your OpenBabel installation. I recommend that you uninstall OpenBabel completely and start again following the instructions on our install page. If you still have a problem, email this list again describing how you installed OpenBabel and whether there were any problems installing it. Other things you may wish to try are: (1) start Python with "python -v" (2) verify that OpenBabel is working by converting a file (3) make sure that you are not running python from the OpenBabel directory. Noel On 27/08/07, Eiso AB <e....@ch...> wrote: > hi > > if I import pybel , my python session > seqfaults on exit. I can do stuff with pybel before exit > as normal. without importing pybel exit is also normal > > > > []$ python2.3 > Python 2.3.4 (#1, Oct 9 2006, 18:22:22) > [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import pybel > >>> [Crtl-D] > Segmentation fault > > > the same happens for python2.4 > > []$ python2.4 > Python 2.4.2 (#8, Jan 25 2006, 19:03:28) > [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import pybel > >>> [Crtl-D] > Segmentation fault > > > > can anyone give me a clue how I can prevent or find the > cause of this behaviour. > > thanks in advance, > > Eiso AB > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |