Quantcast

Cannot use readstring() or readfile()

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

Cannot use readstring() or readfile()

phuongdnp
I have tried installing different version of python (2.7, 3.3, 3.6) and openbabel (2.3, 2.4) (Win 32bit) following these steps:
- Install python
- Install pip
- Install pybel module
- Install openbabel GUI and also openbabel module
- Add the Environment variables to python folders
I can use "import pybel" and "import openbabel" but when I run the examples (mol = readstring("smi", "CCCC")  or readfile()) there always is an error "name 'readstring' is not defined"
I have also tried other windows pc but the same thing happened.
Please help me to fix this. I appreciate very much.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot use readstring() or readfile()

Fredrik Wallner
Hi,

If you do “import pybel” you have to use the module name for the readstring command, ie. pybel.readstring(). Another option is to do “from pybel import readstring”, depending on your use case.

Kind regards,
Fredrik

On 5 mars 2017 20:25 +0100, phuongdnp <[hidden email]>, wrote:
I have tried installing different version of python (2.7, 3.3, 3.6) and
openbabel (2.3, 2.4) (Win 32bit) following these steps:
- Install python
- Install pip
- Install pybel module
- Install openbabel GUI and also openbabel module
- Add the Environment variables to python folders
I can use "import pybel" and "import openbabel" but when I run the examples
(mol = readstring("smi", "CCCC") or readfile()) there always is an error
"name 'readstring' is not defined"
I have also tried other windows pc but the same thing happened.
Please help me to fix this. I appreciate very much.



--
View this message in context: http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
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: Cannot use readstring() or readfile()

Noel O'Boyle
Administrator
In reply to this post by phuongdnp
"pip install openbabel" not "pip install pybel"

On 3 March 2017 at 21:27, phuongdnp <[hidden email]> wrote:

> I have tried installing different version of python (2.7, 3.3, 3.6) and
> openbabel (2.3, 2.4) (Win 32bit) following these steps:
> - Install python
> - Install pip
> - Install pybel module
> - Install openbabel GUI and also openbabel module
> - Add the Environment variables to python folders
> I can use "import pybel" and "import openbabel" but when I run the examples
> (mol = readstring("smi", "CCCC")  or readfile()) there always is an error
> "name 'readstring' is not defined"
> I have also tried other windows pc but the same thing happened.
> Please help me to fix this. I appreciate very much.
>
>
>
> --
> View this message in context: http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795.html
> Sent from the General discussion mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> 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: Cannot use readstring() or readfile()

tlyons@lyonstech.net
Hi Guys,

We have basically the same challenge - which is not answered by the initial response from Frederick.

As you will note from the error message in the subsequent email, readfile and readstring are reported as not being members of pybel. So using pybell.readfile does not work. From your email Frederick, you clearly think is would normally be a member. So there seems an issue in picking up the information.

At my end we have tried numerous approaches to try and resolve this. The openbabel gui works, openbabel, and pybel import happily but, wherever one looks one cannot find readfile or readstring.

Unfortunately this is a showstopper so any pointers as to how to fix it would be much appreciated. We have the most up to date versions of pip, setuptools, wheel, etc.

Thanks

Terry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot use readstring() or readfile()

Noel O'Boyle
Administrator
Did you try my suggestion?

On 18 Mar 2017 3:06 p.m., "[hidden email]" <[hidden email]> wrote:
Hi Guys,

We have basically the same challenge - which is not answered by the initial
response from Frederick.

As you will note from the error message in the subsequent email, readfile
and readstring are reported as not being members of pybel. So using
pybell.readfile does not work. From your email Frederick, you clearly think
is would normally be a member. So there seems an issue in picking up the
information.

At my end we have tried numerous approaches to try and resolve this. The
openbabel gui works, openbabel, and pybel import happily but, wherever one
looks one cannot find readfile or readstring.

Unfortunately this is a showstopper so any pointers as to how to fix it
would be much appreciated. We have the most up to date versions of pip,
setuptools, wheel, etc.

Thanks

Terry




--
View this message in context: http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659829.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
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: Cannot use readstring() or readfile()

tlyons@lyonstech.net
Yes, I did 

python -m pip install openbabel

I guess that is why I was able to import openbabel into Python. 

Does the install order matter? 

On 18 Mar 2017, at 15:17, Noel O'Boyle <[hidden email]> wrote:

Did you try my suggestion?

On 18 Mar 2017 3:06 p.m., "[hidden email]" <[hidden email]> wrote:
Hi Guys,

We have basically the same challenge - which is not answered by the initial
response from Frederick.

As you will note from the error message in the subsequent email, readfile
and readstring are reported as not being members of pybel. So using
pybell.readfile does not work. From your email Frederick, you clearly think
is would normally be a member. So there seems an issue in picking up the
information.

At my end we have tried numerous approaches to try and resolve this. The
openbabel gui works, openbabel, and pybel import happily but, wherever one
looks one cannot find readfile or readstring.

Unfortunately this is a showstopper so any pointers as to how to fix it
would be much appreciated. We have the most up to date versions of pip,
setuptools, wheel, etc.

Thanks

Terry




--
View this message in context: http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659829.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
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: Cannot use readstring() or readfile()

Noel O'Boyle
Administrator
Take a look at pybel.py. The location is given by "print
pybel.__file__" after importing it. Does it have readstring? Our one
does.

On 18 March 2017 at 19:02, Terry Lyons <[hidden email]> wrote:

> Yes, I did
>
> python -m pip install openbabel
>
> I guess that is why I was able to import openbabel into Python.
>
> Does the install order matter?
>
> On 18 Mar 2017, at 15:17, Noel O'Boyle <[hidden email]> wrote:
>
> Did you try my suggestion?
>
> On 18 Mar 2017 3:06 p.m., "[hidden email]" <[hidden email]>
> wrote:
>>
>> Hi Guys,
>>
>> We have basically the same challenge - which is not answered by the
>> initial
>> response from Frederick.
>>
>> As you will note from the error message in the subsequent email, readfile
>> and readstring are reported as not being members of pybel. So using
>> pybell.readfile does not work. From your email Frederick, you clearly
>> think
>> is would normally be a member. So there seems an issue in picking up the
>> information.
>>
>> At my end we have tried numerous approaches to try and resolve this. The
>> openbabel gui works, openbabel, and pybel import happily but, wherever one
>> looks one cannot find readfile or readstring.
>>
>> Unfortunately this is a showstopper so any pointers as to how to fix it
>> would be much appreciated. We have the most up to date versions of pip,
>> setuptools, wheel, etc.
>>
>> Thanks
>>
>> Terry
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659829.html
>> Sent from the General discussion mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> 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: Cannot use readstring() or readfile()

tlyons@lyonstech.net

Hi,

 

When I execute your suggested command I do not get pybel.py instead I get the path to  __init__.py . This is the case with two independent versions of python. No mention of these missing  methods.

 

T

 

X64:

C:\Program Files\Python35>python

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> import pybel

>>> print (pybel.__file__)

C:\Program Files\Python35\lib\site-packages\pybel\__init__.py

>>> 

 

Win32:

>python

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> import pybel

>>> print(pybel.__file__)

C:\ProgramData\chocolatey\lib\python3-x86_32\tools\lib\site-packages\pybel\__init__.py

 

From: Noel O'Boyle [via Open Babel] [mailto:ml-node+[hidden email]]
Sent: 18 March 2017 21:53
To: Terry Lyons <[hidden email]>
Subject: Re: Cannot use readstring() or readfile()

 

Take a look at pybel.py. The location is given by "print
pybel.__file__" after importing it. Does it have readstring? Our one
does.

On 18 March 2017 at 19:02, Terry Lyons <[hidden email]> wrote:


> Yes, I did
>
> python -m pip install openbabel
>
> I guess that is why I was able to import openbabel into Python.
>
> Does the install order matter?
>
> On 18 Mar 2017, at 15:17, Noel O'Boyle <[hidden email]> wrote:
>
> Did you try my suggestion?
>
> On 18 Mar 2017 3:06 p.m., "[hidden email]" <[hidden email]>
> wrote:
>>
>> Hi Guys,
>>
>> We have basically the same challenge - which is not answered by the
>> initial
>> response from Frederick.
>>
>> As you will note from the error message in the subsequent email, readfile
>> and readstring are reported as not being members of pybel. So using
>> pybell.readfile does not work. From your email Frederick, you clearly
>> think
>> is would normally be a member. So there seems an issue in picking up the
>> information.
>>
>> At my end we have tried numerous approaches to try and resolve this. The
>> openbabel gui works, openbabel, and pybel import happily but, wherever one
>> looks one cannot find readfile or readstring.
>>
>> Unfortunately this is a showstopper so any pointers as to how to fix it
>> would be much appreciated. We have the most up to date versions of pip,
>> setuptools, wheel, etc.
>>
>> Thanks
>>
>> Terry
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659829.html
>> Sent from the General discussion mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> 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


If you reply to this email, your message will be added to the discussion below:

http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659836.html

To unsubscribe from Cannot use readstring() or readfile(), click here.
NAML


__init__.py (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot use readstring() or readfile()

Noel O'Boyle
Administrator
Right so - that's not our Pybel then. We have one file, pybel.py,
containing readstring.

I think you have installed pyBEL (the python interface to BEL) with
"pip install pybel". It's starting to get annoying that another newer
project has adopted the same name. Uninstall it, e.g. by removing the
pybel folder, or maybe there's some way to do it with pip, or just
rename the folder to wrongpybel. Feel free to lodge a complaint for
time wasted with the other project, and ask them to rename.

On 19 March 2017 at 20:09, [hidden email] <[hidden email]> wrote:

> Hi,
>
> When I execute your suggested command I do not get pybel.py instead I get the path to  __init__.py . This is the case with two independent versions of python. No mention of these missing  methods.
>
> T
>
> X64:
> C:\Program Files\Python35>python
> Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import pybel
>>>> print (pybel.__file__)
> C:\Program Files\Python35\lib\site-packages\pybel\__init__.py
>>>>
>
> Win32:
>>python
> Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import pybel
>>>> print(pybel.__file__)
> C:\ProgramData\chocolatey\lib\python3-x86_32\tools\lib\site-packages\pybel\__init__.py
>
> From: Noel O'Boyle [via Open Babel] [mailto:[hidden email]]
> Sent: 18 March 2017 21:53
> To: Terry Lyons <[hidden email]>
> Subject: Re: Cannot use readstring() or readfile()
>
> Take a look at pybel.py. The location is given by "print
> pybel.__file__" after importing it. Does it have readstring? Our one
> does.
>
> On 18 March 2017 at 19:02, Terry Lyons <[hidden email]</user/SendEmail.jtp?type=node&node=4659836&i=0>> wrote:
>
>> Yes, I did
>>
>> python -m pip install openbabel
>>
>> I guess that is why I was able to import openbabel into Python.
>>
>> Does the install order matter?
>>
>> On 18 Mar 2017, at 15:17, Noel O'Boyle <[hidden email]</user/SendEmail.jtp?type=node&node=4659836&i=1>> wrote:
>>
>> Did you try my suggestion?
>>
>> On 18 Mar 2017 3:06 p.m., "[hidden email]</user/SendEmail.jtp?type=node&node=4659836&i=2>" <[hidden email]</user/SendEmail.jtp?type=node&node=4659836&i=3>>
>> wrote:
>>>
>>> Hi Guys,
>>>
>>> We have basically the same challenge - which is not answered by the
>>> initial
>>> response from Frederick.
>>>
>>> As you will note from the error message in the subsequent email, readfile
>>> and readstring are reported as not being members of pybel. So using
>>> pybell.readfile does not work. From your email Frederick, you clearly
>>> think
>>> is would normally be a member. So there seems an issue in picking up the
>>> information.
>>>
>>> At my end we have tried numerous approaches to try and resolve this. The
>>> openbabel gui works, openbabel, and pybel import happily but, wherever one
>>> looks one cannot find readfile or readstring.
>>>
>>> Unfortunately this is a showstopper so any pointers as to how to fix it
>>> would be much appreciated. We have the most up to date versions of pip,
>>> setuptools, wheel, etc.
>>>
>>> Thanks
>>>
>>> Terry
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659829.html
>>> Sent from the General discussion mailing list archive at Nabble.com.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> 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]</user/SendEmail.jtp?type=node&node=4659836&i=4>
>>> 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]</user/SendEmail.jtp?type=node&node=4659836&i=5>
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659836.html
> To unsubscribe from Cannot use readstring() or readfile(), click here<
> NAML<
http://forums.openbabel.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
> __init__.py (2K) <http://forums.openbabel.org/attachment/4659837/0/__init__.py>
>
>
>
>
> --
> View this message in context: http://forums.openbabel.org/Cannot-use-readstring-or-readfile-tp4659795p4659837.html
> Sent from the General discussion mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> 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
Loading...