about Python binding

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

about Python binding

seritaka
Hi
I'm biginer of programing.

I want to use openbabel on python.

So I installed PIL and Python binding.
But test Script dosen't run.
this is the test script
----------------------------------
import openbabel

mol = openbabel.OBMol()
conv = openbabel.OBConversion()
conv.SetInAndOutFormats("smi","mdl")
conv.ReadString(mol,"c1ccccc1O")
print mol.NumAtoms()
mol.AddHydrogens()
print mol.NumAtoms()
conv.WriteFile(mol,'phenol.mol')
--------------------------------------
when run the script
return
0
0...
i can't find any reason.


and
input
"import pybel"

>>> import pybel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python\lib\site-packages\pybel.py", line 37, in <module
>
    informats = _formatstodict(_obconv.GetSupportedInputFormat())
  File "C:\Program Files\Python\lib\site-packages\pybel.py", line 33, in _format
stodict
    broken = [(x,y.strip()) for x,y in broken]
ValueError: need more than 1 value to unpack

i can't find any reason.
please help me.
Cheers,


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: about Python binding

Noel O'Boyle
Administrator
Hi Takayuki,

Sounds like something is wrong with your installation...

What version of Open Babel are you using? What operating system? Do
you already have another Open Babel installed on your computer? Does
"obabel -L formats" list 80 or so formats?

- Noel

On 2 January 2011 13:22, takayuki serizawa <[hidden email]> wrote:

> Hi
> I'm biginer of programing.
>
> I want to use openbabel on python.
>
> So I installed PIL and Python binding.
> But test Script dosen't run.
> this is the test script
> ----------------------------------
> import openbabel
>
> mol = openbabel.OBMol()
> conv = openbabel.OBConversion()
> conv.SetInAndOutFormats("smi","mdl")
> conv.ReadString(mol,"c1ccccc1O")
> print mol.NumAtoms()
> mol.AddHydrogens()
> print mol.NumAtoms()
> conv.WriteFile(mol,'phenol.mol')
> --------------------------------------
> when run the script
> return
> 0
> 0...
> i can't find any reason.
>
>
> and
> input
> "import pybel"
>
>>>> import pybel
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "C:\Program Files\Python\lib\site-packages\pybel.py", line 37, in
> <module
>>
>     informats = _formatstodict(_obconv.GetSupportedInputFormat())
>   File "C:\Program Files\Python\lib\site-packages\pybel.py", line 33, in
> _format
> stodict
>     broken = [(x,y.strip()) for x,y in broken]
> ValueError: need more than 1 value to unpack
>
> i can't find any reason.
> please help me.
>
> Cheers,
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: about Python binding

Noel O'Boyle
Administrator
Sorry - I meant to cc to openbabel-discuss....

On 7 January 2011 17:31, Noel O'Boyle <[hidden email]> wrote:

> (Please cc to the list)
>
> What happens when you follow the steps described in "Test the installation" at:
>   http://openbabel.org/docs/2.3.0/UseTheLibrary/PythonInstall.html#test-the-installation
>
> - Noel
>
> On 3 January 2011 13:36, takayuki serizawa <[hidden email]> wrote:
>> Dear Noel O'Boyle.
>>
>> Thank you for your e-mai.
>> I using Python ver 2.5 and OpenBabel-2.3.0(GUI).
>> Operateing system is Windows Xp professional.
>>
>> When I input "obabel -L formats", total 153 list appeared.
>> I reffered this HP
>> "http://openbabel.org/docs/2.3.0/UseTheLibrary/PythonInstall.html".
>>
>> Maybe from command prompt, Openbabel work works well.
>>
>> Sincerely
>>
>> 2011/1/3 Noel O'Boyle <[hidden email]>
>>>
>>> Hi Takayuki,
>>>
>>> Sounds like something is wrong with your installation...
>>>
>>> What version of Open Babel are you using? What operating system? Do
>>> you already have another Open Babel installed on your computer? Does
>>> "obabel -L formats" list 80 or so formats?
>>>
>>> - Noel
>>>
>>> On 2 January 2011 13:22, takayuki serizawa <[hidden email]> wrote:
>>> > Hi
>>> > I'm biginer of programing.
>>> >
>>> > I want to use openbabel on python.
>>> >
>>> > So I installed PIL and Python binding.
>>> > But test Script dosen't run.
>>> > this is the test script
>>> > ----------------------------------
>>> > import openbabel
>>> >
>>> > mol = openbabel.OBMol()
>>> > conv = openbabel.OBConversion()
>>> > conv.SetInAndOutFormats("smi","mdl")
>>> > conv.ReadString(mol,"c1ccccc1O")
>>> > print mol.NumAtoms()
>>> > mol.AddHydrogens()
>>> > print mol.NumAtoms()
>>> > conv.WriteFile(mol,'phenol.mol')
>>> > --------------------------------------
>>> > when run the script
>>> > return
>>> > 0
>>> > 0...
>>> > i can't find any reason.
>>> >
>>> >
>>> > and
>>> > input
>>> > "import pybel"
>>> >
>>> >>>> import pybel
>>> > Traceback (most recent call last):
>>> >   File "<stdin>", line 1, in <module>
>>> >   File "C:\Program Files\Python\lib\site-packages\pybel.py", line 37, in
>>> > <module
>>> >>
>>> >     informats = _formatstodict(_obconv.GetSupportedInputFormat())
>>> >   File "C:\Program Files\Python\lib\site-packages\pybel.py", line 33, in
>>> > _format
>>> > stodict
>>> >     broken = [(x,y.strip()) for x,y in broken]
>>> > ValueError: need more than 1 value to unpack
>>> >
>>> > i can't find any reason.
>>> > please help me.
>>> >
>>> > Cheers,
>>> >
>>> >
>>> >
>>> > ------------------------------------------------------------------------------
>>> > Learn how Oracle Real Application Clusters (RAC) One Node allows
>>> > customers
>>> > to consolidate database storage, standardize their database environment,
>>> > and,
>>> > should the need arise, upgrade to a full multi-node Oracle RAC database
>>> > without downtime or disruption
>>> > http://p.sf.net/sfu/oracle-sfdevnl
>>> > _______________________________________________
>>> > OpenBabel-discuss mailing list
>>> > [hidden email]
>>> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>> >
>>> >
>>
>>
>

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: about Python binding

seritaka
Dire Noel.
I am sorry to late response.
I tried reinstall python, openbabell.
Then the program worked well.
The reason, I think, i moved python folder after install.
Thank you for your kindness.


On Jan 8, 2011, at 2:31 AM, "Noel O'Boyle" <[hidden email]> wrote:

> Sorry - I meant to cc to openbabel-discuss....
>
> On 7 January 2011 17:31, Noel O'Boyle <[hidden email]> wrote:
>> (Please cc to the list)
>>
>> What happens when you follow the steps described in "Test the installation" at:
>>   http://openbabel.org/docs/2.3.0/UseTheLibrary/PythonInstall.html#test-the-installation
>>
>> - Noel
>>
>> On 3 January 2011 13:36, takayuki serizawa <[hidden email]> wrote:
>>> Dear Noel O'Boyle.
>>>
>>> Thank you for your e-mai.
>>> I using Python ver 2.5 and OpenBabel-2.3.0(GUI).
>>> Operateing system is Windows Xp professional.
>>>
>>> When I input "obabel -L formats", total 153 list appeared.
>>> I reffered this HP
>>> "http://openbabel.org/docs/2.3.0/UseTheLibrary/PythonInstall.html".
>>>
>>> Maybe from command prompt, Openbabel work works well.
>>>
>>> Sincerely
>>>
>>> 2011/1/3 Noel O'Boyle <[hidden email]>
>>>>
>>>> Hi Takayuki,
>>>>
>>>> Sounds like something is wrong with your installation...
>>>>
>>>> What version of Open Babel are you using? What operating system? Do
>>>> you already have another Open Babel installed on your computer? Does
>>>> "obabel -L formats" list 80 or so formats?
>>>>
>>>> - Noel
>>>>
>>>> On 2 January 2011 13:22, takayuki serizawa <[hidden email]> wrote:
>>>>> Hi
>>>>> I'm biginer of programing.
>>>>>
>>>>> I want to use openbabel on python.
>>>>>
>>>>> So I installed PIL and Python binding.
>>>>> But test Script dosen't run.
>>>>> this is the test script
>>>>> ----------------------------------
>>>>> import openbabel
>>>>>
>>>>> mol = openbabel.OBMol()
>>>>> conv = openbabel.OBConversion()
>>>>> conv.SetInAndOutFormats("smi","mdl")
>>>>> conv.ReadString(mol,"c1ccccc1O")
>>>>> print mol.NumAtoms()
>>>>> mol.AddHydrogens()
>>>>> print mol.NumAtoms()
>>>>> conv.WriteFile(mol,'phenol.mol')
>>>>> --------------------------------------
>>>>> when run the script
>>>>> return
>>>>> 0
>>>>> 0...
>>>>> i can't find any reason.
>>>>>
>>>>>
>>>>> and
>>>>> input
>>>>> "import pybel"
>>>>>
>>>>>>>> import pybel
>>>>> Traceback (most recent call last):
>>>>>   File "<stdin>", line 1, in <module>
>>>>>   File "C:\Program Files\Python\lib\site-packages\pybel.py", line 37, in
>>>>> <module
>>>>>>
>>>>>     informats = _formatstodict(_obconv.GetSupportedInputFormat())
>>>>>   File "C:\Program Files\Python\lib\site-packages\pybel.py", line 33, in
>>>>> _format
>>>>> stodict
>>>>>     broken = [(x,y.strip()) for x,y in broken]
>>>>> ValueError: need more than 1 value to unpack
>>>>>
>>>>> i can't find any reason.
>>>>> please help me.
>>>>>
>>>>> Cheers,
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Learn how Oracle Real Application Clusters (RAC) One Node allows
>>>>> customers
>>>>> to consolidate database storage, standardize their database environment,
>>>>> and,
>>>>> should the need arise, upgrade to a full multi-node Oracle RAC database
>>>>> without downtime or disruption
>>>>> http://p.sf.net/sfu/oracle-sfdevnl
>>>>> _______________________________________________
>>>>> OpenBabel-discuss mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>>>>
>>>>>
>>>
>>>
>>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss