Quantcast

How to run readstring in pybel?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to run readstring in pybel?

Peng Yu
Hi, I got the following error. Does anybody know what is wrong? Thanks.

$ cat main.py
#!/usr/bin/env python

import pybel
mymol = pybel.readstring("smi", "CCCC")
print mymol.molwt
$ ./main.py
Traceback (most recent call last):
  File "./main.py", line 5, in <module>
    mymol = pybel.readstring("smi", "CCCC")
AttributeError: 'module' object has no attribute 'readstring'

--
Regards,
Peng

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run readstring in pybel?

杨弘宾
Hi, Peng,
    
    I guess you installed pybel via `pip install pybel`, which is the "wrong" pybel (https://pypi.python.org/pypi/PyBEL/0.5.4 ) You should install openbabel and use it's pthon wrapper via `pip install openbabel` (https://pypi.python.org/pypi/openbabel/2.4.1 ).


Hongbin Yang 
 
Date: 2017-05-08 09:07
Subject: [Open Babel] How to run readstring in pybel?
Hi, I got the following error. Does anybody know what is wrong? Thanks.
 
$ cat main.py
#!/usr/bin/env python
 
import pybel
mymol = pybel.readstring("smi", "CCCC")
print mymol.molwt
$ ./main.py
Traceback (most recent call last):
  File "./main.py", line 5, in <module>
    mymol = pybel.readstring("smi", "CCCC")
AttributeError: 'module' object has no attribute 'readstring'
 
--
Regards,
Peng
 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run readstring in pybel?

Peng Yu
Hi, I should have installed the correct one. But readstring() is not available.

>>> print pybel.__dict__.keys()
['to_bel_path', 'from_json', 'from_cx_path', 'utils', 'parser',
'__path__', 'manager', 'to_json', 'io', 'canonicalize', 'from_pickle',
'to_pickle', 'from_jsons', 'to_bytes', 'from_cx', '__all__',
'BELGraph', 'graph', 'from_cx_jsons', 'NDEX_SOURCE_FORMAT',
'__package__', 'to_bel', 'from_lines', 'from_cx_json', '__doc__',
'to_neo4j', '__title__', 'to_cx_json', '__license__', 'to_jsons',
'__builtins__', '__file__', 'to_cx_jsons', '__author__', 'to_csv',
'from_json_dict', 'from_path', '__name__', 'from_url', '__version__',
'constants', 'to_bel_lines', '__url__', '__copyright__',
'to_json_dict', '__description__', '__email__', 'to_cx',
'from_database', 'to_graphml', 'to_database', 'exceptions',
'database_io', 'from_bytes']

On Sun, May 7, 2017 at 9:20 PM, Hongbin Yang <[hidden email]> wrote:

> Hi, Peng,
>
>     I guess you installed pybel via `pip install pybel`, which is the
> "wrong" pybel (https://pypi.python.org/pypi/PyBEL/0.5.4 ) You should install
> openbabel and use it's pthon wrapper via `pip install openbabel`
> (https://pypi.python.org/pypi/openbabel/2.4.1 ).
>
> ________________________________
> Hongbin Yang
>
>
> From: Peng Yu
> Date: 2017-05-08 09:07
> To: openbabel-discuss
> Subject: [Open Babel] How to run readstring in pybel?
> Hi, I got the following error. Does anybody know what is wrong? Thanks.
>
> $ cat main.py
> #!/usr/bin/env python
>
> import pybel
> mymol = pybel.readstring("smi", "CCCC")
> print mymol.molwt
> $ ./main.py
> Traceback (most recent call last):
>   File "./main.py", line 5, in <module>
>     mymol = pybel.readstring("smi", "CCCC")
> AttributeError: 'module' object has no attribute 'readstring'
>
> --
> Regards,
> Peng
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss



--
Regards,
Peng

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run readstring in pybel?

David Hall
That is still the wrong pybel. You should uninstall it (i.e. pip uninstall pybel )


> On May 7, 2017, at 10:38 PM, Peng Yu <[hidden email]> wrote:
>
> Hi, I should have installed the correct one. But readstring() is not available.
>
>>>> print pybel.__dict__.keys()
> ['to_bel_path', 'from_json', 'from_cx_path', 'utils', 'parser',
> '__path__', 'manager', 'to_json', 'io', 'canonicalize', 'from_pickle',
> 'to_pickle', 'from_jsons', 'to_bytes', 'from_cx', '__all__',
> 'BELGraph', 'graph', 'from_cx_jsons', 'NDEX_SOURCE_FORMAT',
> '__package__', 'to_bel', 'from_lines', 'from_cx_json', '__doc__',
> 'to_neo4j', '__title__', 'to_cx_json', '__license__', 'to_jsons',
> '__builtins__', '__file__', 'to_cx_jsons', '__author__', 'to_csv',
> 'from_json_dict', 'from_path', '__name__', 'from_url', '__version__',
> 'constants', 'to_bel_lines', '__url__', '__copyright__',
> 'to_json_dict', '__description__', '__email__', 'to_cx',
> 'from_database', 'to_graphml', 'to_database', 'exceptions',
> 'database_io', 'from_bytes']
>
> On Sun, May 7, 2017 at 9:20 PM, Hongbin Yang <[hidden email]> wrote:
>> Hi, Peng,
>>
>>    I guess you installed pybel via `pip install pybel`, which is the
>> "wrong" pybel (https://pypi.python.org/pypi/PyBEL/0.5.4 ) You should install
>> openbabel and use it's pthon wrapper via `pip install openbabel`
>> (https://pypi.python.org/pypi/openbabel/2.4.1 ).
>>
>> ________________________________
>> Hongbin Yang
>>
>>
>> From: Peng Yu
>> Date: 2017-05-08 09:07
>> To: openbabel-discuss
>> Subject: [Open Babel] How to run readstring in pybel?
>> Hi, I got the following error. Does anybody know what is wrong? Thanks.
>>
>> $ cat main.py
>> #!/usr/bin/env python
>>
>> import pybel
>> mymol = pybel.readstring("smi", "CCCC")
>> print mymol.molwt
>> $ ./main.py
>> Traceback (most recent call last):
>>  File "./main.py", line 5, in <module>
>>    mymol = pybel.readstring("smi", "CCCC")
>> AttributeError: 'module' object has no attribute 'readstring'
>>
>> --
>> Regards,
>> Peng
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
>
> --
> Regards,
> Peng
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run readstring in pybel?

Peng Yu
OK. It fixed the problem. Thanks.

On Sun, May 7, 2017 at 9:41 PM, David Hall <[hidden email]> wrote:

> That is still the wrong pybel. You should uninstall it (i.e. pip uninstall pybel )
>
>
>> On May 7, 2017, at 10:38 PM, Peng Yu <[hidden email]> wrote:
>>
>> Hi, I should have installed the correct one. But readstring() is not available.
>>
>>>>> print pybel.__dict__.keys()
>> ['to_bel_path', 'from_json', 'from_cx_path', 'utils', 'parser',
>> '__path__', 'manager', 'to_json', 'io', 'canonicalize', 'from_pickle',
>> 'to_pickle', 'from_jsons', 'to_bytes', 'from_cx', '__all__',
>> 'BELGraph', 'graph', 'from_cx_jsons', 'NDEX_SOURCE_FORMAT',
>> '__package__', 'to_bel', 'from_lines', 'from_cx_json', '__doc__',
>> 'to_neo4j', '__title__', 'to_cx_json', '__license__', 'to_jsons',
>> '__builtins__', '__file__', 'to_cx_jsons', '__author__', 'to_csv',
>> 'from_json_dict', 'from_path', '__name__', 'from_url', '__version__',
>> 'constants', 'to_bel_lines', '__url__', '__copyright__',
>> 'to_json_dict', '__description__', '__email__', 'to_cx',
>> 'from_database', 'to_graphml', 'to_database', 'exceptions',
>> 'database_io', 'from_bytes']
>>
>> On Sun, May 7, 2017 at 9:20 PM, Hongbin Yang <[hidden email]> wrote:
>>> Hi, Peng,
>>>
>>>    I guess you installed pybel via `pip install pybel`, which is the
>>> "wrong" pybel (https://pypi.python.org/pypi/PyBEL/0.5.4 ) You should install
>>> openbabel and use it's pthon wrapper via `pip install openbabel`
>>> (https://pypi.python.org/pypi/openbabel/2.4.1 ).
>>>
>>> ________________________________
>>> Hongbin Yang
>>>
>>>
>>> From: Peng Yu
>>> Date: 2017-05-08 09:07
>>> To: openbabel-discuss
>>> Subject: [Open Babel] How to run readstring in pybel?
>>> Hi, I got the following error. Does anybody know what is wrong? Thanks.
>>>
>>> $ cat main.py
>>> #!/usr/bin/env python
>>>
>>> import pybel
>>> mymol = pybel.readstring("smi", "CCCC")
>>> print mymol.molwt
>>> $ ./main.py
>>> Traceback (most recent call last):
>>>  File "./main.py", line 5, in <module>
>>>    mymol = pybel.readstring("smi", "CCCC")
>>> AttributeError: 'module' object has no attribute 'readstring'
>>>
>>> --
>>> Regards,
>>> Peng
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> OpenBabel-discuss mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>>
>>
>> --
>> Regards,
>> Peng
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>



--
Regards,
Peng

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run readstring in pybel?

supplyservice
This post has NOT been accepted by the mailing list yet.
In reply to this post by Peng Yu
This article include simple program for readstring in pybel.this is the new informations  for me.i really like to read this article.thanks a lot for sharing this post.
Loading...