Quantcast

install of open babel for pymol under window 10 - BABEL_DATADIR issues??

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

install of open babel for pymol under window 10 - BABEL_DATADIR issues??

Thomas Ryckmans
Dear all,

I am trying to install openbabel to run the Optimize plugin in Pymol (http://www.pymolwiki.org/index.php/Optimize).
I installed the OpenBabelGUI 2.3.2
I am using python 2.7 (Anaconda) with a 64 bit computer, so I I installed openbabel-1.8.4-cp27-none-win_amd64.whl, and the python bindings.

It seems to work: I can follow the command lines here:
and it works - e.g. these
>>> import pybel
>>> mol = pybel.readstring("smi", "CC(=O)Br")
>>> mol.make3D()
>>> print(mol.write("sdf"))
give the expected output.


However when I run pymol and try to use Optimize, I get the following error message:
---------------------------------------------------------------
Error: 1
<type 'exceptions.NameError'> Exception in Tk callback
  Function: <function set_conf_search at 0x0000000009CB02E8> (type: <type 'function'>)
  Args: ()
Traceback (innermost last):
  File "C:\Program Files\PyMOL\\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py", line 1747, in __call__
    return apply(self.func, args)
  File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line 52, in set_conf_search
    conf_search(selection, forcefield, conf_method, nsteps1, conformers, lowest_conf)
  File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line 266, in conf_search
    obconversion = ob.OBConversion()
<type 'exceptions.NameError'>: global name 'ob' is not defined
----------------------------------------------------------------
I am assuming (...) that this is because pymol does not know where to find openbabel. How can I change that??

In the openbabel directory, there is a file called babelconfig.h;
containing these two lines:
/* Where the data files are located */
#define BABEL_DATADIR "C:/Program Files/openbabel/share/openbabel"

while the data folder is actually elsewhere: C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel

if I try to change the babelconfig.h file to
/* Where the data files are located */
#define BABEL_DATADIR "C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel"...
nothing changes...

many thanks for your help!

Thomas



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: install of open babel for pymol under window 10 - BABEL_DATADIR issues??

Noel O'Boyle
Administrator

You should ask the Pymol devs. Have you tried setting PYTHONPATH before running Pymol?

On 13 Jul 2016 5:55 p.m., "Thomas Ryckmans" <[hidden email]> wrote:
Dear all,

I am trying to install openbabel to run the Optimize plugin in Pymol (http://www.pymolwiki.org/index.php/Optimize).
I installed the OpenBabelGUI 2.3.2
I am using python 2.7 (Anaconda) with a 64 bit computer, so I I installed openbabel-1.8.4-cp27-none-win_amd64.whl, and the python bindings.

It seems to work: I can follow the command lines here:
and it works - e.g. these
>>> import pybel
>>> mol = pybel.readstring("smi", "CC(=O)Br")
>>> mol.make3D()
>>> print(mol.write("sdf"))
give the expected output.


However when I run pymol and try to use Optimize, I get the following error message:
---------------------------------------------------------------
Error: 1
<type 'exceptions.NameError'> Exception in Tk callback
  Function: <function set_conf_search at 0x0000000009CB02E8> (type: <type 'function'>)
  Args: ()
Traceback (innermost last):
  File "C:\Program Files\PyMOL\\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py", line 1747, in __call__
    return apply(self.func, args)
  File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line 52, in set_conf_search
    conf_search(selection, forcefield, conf_method, nsteps1, conformers, lowest_conf)
  File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line 266, in conf_search
    obconversion = ob.OBConversion()
<type 'exceptions.NameError'>: global name 'ob' is not defined
----------------------------------------------------------------
I am assuming (...) that this is because pymol does not know where to find openbabel. How can I change that??

In the openbabel directory, there is a file called babelconfig.h;
containing these two lines:
/* Where the data files are located */
#define BABEL_DATADIR "C:/Program Files/openbabel/share/openbabel"

while the data folder is actually elsewhere: C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel

if I try to change the babelconfig.h file to
/* Where the data files are located */
#define BABEL_DATADIR "C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel"...
nothing changes...

many thanks for your help!

Thomas



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: install of open babel for pymol under window 10 - BABEL_DATADIR issues??

Noel O'Boyle
Administrator
(please cc the list)

When I said the command prompt, I meant the Windows command prompt.
PYTHONPATH is an environment variable.

You really should contact the author of the plugin at this point - he
can easily tell you how to do it.

- Noel

On 14 July 2016 at 17:59, Thomas Ryckmans <[hidden email]> wrote:

> Hi Noel,
>
> I ran the sys.path.append... when I type pymol in the command line I get
>
>>>> Pymol
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'Pymol' is not defined
>
> Yet I have installed pymol (from a .msi: EduPyMOL-v1.7.4.5-Win64)
>
> If I run pymol (I use the "C:\Program Files\PyMOL\PyMOL\PymolWin.exe" -J), I
> can use the python command line...
>
> is there another installer that would give me a pymol.py file??
>
> many thanks
>
> Thomas
>
> On 14 July 2016 at 07:55, Noel O'Boyle <[hidden email]> wrote:
>>
>> Just try setting the PYTHONPATH at the command line before running Pymol
>> at the same command line.
>>
>> On 13 Jul 2016 9:54 p.m., "Thomas Ryckmans" <[hidden email]>
>> wrote:
>>>
>>> Hi Noel,
>>>
>>> thank you so much for your comment - I am a newbie and very much stuck.
>>> I tried both
>>>
>>> import sys
>>>
>>> sys.path.append("C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel\data")
>>> print sys.path
>>>
>>> import sys
>>> sys.path.append("C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel")
>>> print sys.path
>>>
>>> but I still get an error message:
>>>
>>> Error: 1
>>> <type 'exceptions.NameError'> Exception in Tk callback
>>>   Function: <function set_conf_search at 0x00000000031FA2E8> (type: <type
>>> 'function'>)
>>>   Args: ()
>>> Traceback (innermost last):
>>>   File "C:\Program
>>> Files\PyMOL\\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py", line 1747, in
>>> __call__
>>>     return apply(self.func, args)
>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line
>>> 52, in set_conf_search
>>>     conf_search(selection, forcefield, conf_method, nsteps1, conformers,
>>> lowest_conf)
>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line
>>> 266, in conf_search
>>>     obconversion = ob.OBConversion()
>>> <type 'exceptions.NameError'>: global name 'ob' is not defined
>>>
>>> any ideas of what I should do next??
>>>
>>> Thomas
>>>
>>> On 13 July 2016 at 21:28, Noel O'Boyle <[hidden email]> wrote:
>>>>
>>>> You should ask the Pymol devs. Have you tried setting PYTHONPATH before
>>>> running Pymol?
>>>>
>>>> On 13 Jul 2016 5:55 p.m., "Thomas Ryckmans" <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Dear all,
>>>>>
>>>>> I am trying to install openbabel to run the Optimize plugin in Pymol
>>>>> (http://www.pymolwiki.org/index.php/Optimize).
>>>>> I installed the OpenBabelGUI 2.3.2
>>>>> I am using python 2.7 (Anaconda) with a 64 bit computer, so I I
>>>>> installed openbabel-1.8.4-cp27-none-win_amd64.whl, and the python bindings.
>>>>>
>>>>> It seems to work: I can follow the command lines here:
>>>>> and it works - e.g. these
>>>>>
>>>>> >>> import pybel
>>>>> >>> mol = pybel.readstring("smi", "CC(=O)Br")
>>>>> >>> mol.make3D()
>>>>> >>> print(mol.write("sdf"))
>>>>>
>>>>> give the expected output.
>>>>>
>>>>>
>>>>> However when I run pymol and try to use Optimize, I get the following
>>>>> error message:
>>>>> ---------------------------------------------------------------
>>>>> Error: 1
>>>>> <type 'exceptions.NameError'> Exception in Tk callback
>>>>>   Function: <function set_conf_search at 0x0000000009CB02E8> (type:
>>>>> <type 'function'>)
>>>>>   Args: ()
>>>>> Traceback (innermost last):
>>>>>   File "C:\Program
>>>>> Files\PyMOL\\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py", line 1747, in
>>>>> __call__
>>>>>     return apply(self.func, args)
>>>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py",
>>>>> line 52, in set_conf_search
>>>>>     conf_search(selection, forcefield, conf_method, nsteps1,
>>>>> conformers, lowest_conf)
>>>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py",
>>>>> line 266, in conf_search
>>>>>     obconversion = ob.OBConversion()
>>>>> <type 'exceptions.NameError'>: global name 'ob' is not defined
>>>>> ----------------------------------------------------------------
>>>>> I am assuming (...) that this is because pymol does not know where to
>>>>> find openbabel. How can I change that??
>>>>>
>>>>> In the openbabel directory, there is a file called babelconfig.h;
>>>>> containing these two lines:
>>>>> /* Where the data files are located */
>>>>> #define BABEL_DATADIR "C:/Program Files/openbabel/share/openbabel"
>>>>>
>>>>> while the data folder is actually elsewhere:
>>>>> C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel
>>>>>
>>>>> if I try to change the babelconfig.h file to
>>>>> /* Where the data files are located */
>>>>> #define BABEL_DATADIR
>>>>> "C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel"...
>>>>> nothing changes...
>>>>>
>>>>> many thanks for your help!
>>>>>
>>>>> Thomas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>>>> traffic
>>>>> patterns at an interface-level. Reveals which users, apps, and
>>>>> protocols are
>>>>> consuming the most bandwidth. Provides multi-vendor support for
>>>>> NetFlow,
>>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>>>>> planning
>>>>> reports.http://sdm.link/zohodev2dev
>>>>> _______________________________________________
>>>>> OpenBabel-discuss mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>>>>
>>>
>

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: install of open babel for pymol under window 10 - BABEL_DATADIR issues??

Thomas Ryckmans
Thanks Noel - looking at the PyMol Mailing list, it looks like this already happened... and the author of the post concludes this is an Open Babel issue, not a Pymol issue :-)
https://sourceforge.net/p/pymol/mailman/message/33031324/

Will try again tonight...

many thanks

Thomas

On 15 July 2016 at 14:41, Noel O'Boyle <[hidden email]> wrote:
(please cc the list)

When I said the command prompt, I meant the Windows command prompt.
PYTHONPATH is an environment variable.

You really should contact the author of the plugin at this point - he
can easily tell you how to do it.

- Noel

On 14 July 2016 at 17:59, Thomas Ryckmans <[hidden email]> wrote:
> Hi Noel,
>
> I ran the sys.path.append... when I type pymol in the command line I get
>
>>>> Pymol
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'Pymol' is not defined
>
> Yet I have installed pymol (from a .msi: EduPyMOL-v1.7.4.5-Win64)
>
> If I run pymol (I use the "C:\Program Files\PyMOL\PyMOL\PymolWin.exe" -J), I
> can use the python command line...
>
> is there another installer that would give me a pymol.py file??
>
> many thanks
>
> Thomas
>
> On 14 July 2016 at 07:55, Noel O'Boyle <[hidden email]> wrote:
>>
>> Just try setting the PYTHONPATH at the command line before running Pymol
>> at the same command line.
>>
>> On 13 Jul 2016 9:54 p.m., "Thomas Ryckmans" <[hidden email]>
>> wrote:
>>>
>>> Hi Noel,
>>>
>>> thank you so much for your comment - I am a newbie and very much stuck.
>>> I tried both
>>>
>>> import sys
>>>
>>> sys.path.append("C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel\data")
>>> print sys.path
>>>
>>> import sys
>>> sys.path.append("C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel")
>>> print sys.path
>>>
>>> but I still get an error message:
>>>
>>> Error: 1
>>> <type 'exceptions.NameError'> Exception in Tk callback
>>>   Function: <function set_conf_search at 0x00000000031FA2E8> (type: <type
>>> 'function'>)
>>>   Args: ()
>>> Traceback (innermost last):
>>>   File "C:\Program
>>> Files\PyMOL\\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py", line 1747, in
>>> __call__
>>>     return apply(self.func, args)
>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line
>>> 52, in set_conf_search
>>>     conf_search(selection, forcefield, conf_method, nsteps1, conformers,
>>> lowest_conf)
>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py", line
>>> 266, in conf_search
>>>     obconversion = ob.OBConversion()
>>> <type 'exceptions.NameError'>: global name 'ob' is not defined
>>>
>>> any ideas of what I should do next??
>>>
>>> Thomas
>>>
>>> On 13 July 2016 at 21:28, Noel O'Boyle <[hidden email]> wrote:
>>>>
>>>> You should ask the Pymol devs. Have you tried setting PYTHONPATH before
>>>> running Pymol?
>>>>
>>>> On 13 Jul 2016 5:55 p.m., "Thomas Ryckmans" <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Dear all,
>>>>>
>>>>> I am trying to install openbabel to run the Optimize plugin in Pymol
>>>>> (http://www.pymolwiki.org/index.php/Optimize).
>>>>> I installed the OpenBabelGUI 2.3.2
>>>>> I am using python 2.7 (Anaconda) with a 64 bit computer, so I I
>>>>> installed openbabel-1.8.4-cp27-none-win_amd64.whl, and the python bindings.
>>>>>
>>>>> It seems to work: I can follow the command lines here:
>>>>> and it works - e.g. these
>>>>>
>>>>> >>> import pybel
>>>>> >>> mol = pybel.readstring("smi", "CC(=O)Br")
>>>>> >>> mol.make3D()
>>>>> >>> print(mol.write("sdf"))
>>>>>
>>>>> give the expected output.
>>>>>
>>>>>
>>>>> However when I run pymol and try to use Optimize, I get the following
>>>>> error message:
>>>>> ---------------------------------------------------------------
>>>>> Error: 1
>>>>> <type 'exceptions.NameError'> Exception in Tk callback
>>>>>   Function: <function set_conf_search at 0x0000000009CB02E8> (type:
>>>>> <type 'function'>)
>>>>>   Args: ()
>>>>> Traceback (innermost last):
>>>>>   File "C:\Program
>>>>> Files\PyMOL\\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py", line 1747, in
>>>>> __call__
>>>>>     return apply(self.func, args)
>>>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py",
>>>>> line 52, in set_conf_search
>>>>>     conf_search(selection, forcefield, conf_method, nsteps1,
>>>>> conformers, lowest_conf)
>>>>>   File "C:\Users\Thomas\AppData\Roaming\pymol\startup\optimize.py",
>>>>> line 266, in conf_search
>>>>>     obconversion = ob.OBConversion()
>>>>> <type 'exceptions.NameError'>: global name 'ob' is not defined
>>>>> ----------------------------------------------------------------
>>>>> I am assuming (...) that this is because pymol does not know where to
>>>>> find openbabel. How can I change that??
>>>>>
>>>>> In the openbabel directory, there is a file called babelconfig.h;
>>>>> containing these two lines:
>>>>> /* Where the data files are located */
>>>>> #define BABEL_DATADIR "C:/Program Files/openbabel/share/openbabel"
>>>>>
>>>>> while the data folder is actually elsewhere:
>>>>> C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel
>>>>>
>>>>> if I try to change the babelconfig.h file to
>>>>> /* Where the data files are located */
>>>>> #define BABEL_DATADIR
>>>>> "C:\Users\Thomas\Anaconda2\Lib\site-packages\openbabel"...
>>>>> nothing changes...
>>>>>
>>>>> many thanks for your help!
>>>>>
>>>>> Thomas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>>>> traffic
>>>>> patterns at an interface-level. Reveals which users, apps, and
>>>>> protocols are
>>>>> consuming the most bandwidth. Provides multi-vendor support for
>>>>> NetFlow,
>>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>>>>> planning
>>>>> reports.http://sdm.link/zohodev2dev
>>>>> _______________________________________________
>>>>> OpenBabel-discuss mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>>>>
>>>
>


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: install of open babel for pymol under window 10 - BABEL_DATADIR issues??

eolmon
Dear Thomas,

I am having the same problem ("global name 'ob' is not defined'"). openbable is working, and I'm running openbabel-1.8.4-cp27-none-win_amd64.whl.

Have you found a solution?

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

Re: install of open babel for pymol under window 10 - BABEL_DATADIR issues??

Thomas Ryckmans
Hi Eric
I contacted Osvaldo cc d on this (he wrote Optimize) and he kindly offered some help - but I never managed to get optimize to run
Am traveling now but will have a look again next week
Best
Thomas

On Saturday, 10 September 2016, eolmon <[hidden email]> wrote:
Dear Thomas,

I am having the same problem ("global name 'ob' is not defined'"). openbable
is working, and I'm running openbabel-1.8.4-cp27-none-win_amd64.whl.

Have you found a solution?

Thanks
Eric



--
View this message in context: http://forums.openbabel.org/install-of-open-babel-for-pymol-under-window-10-BABEL-DATADIR-issues-tp4659378p4659464.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
OpenBabel-discuss mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;OpenBabel-discuss@lists.sourceforge.net&#39;)">OpenBabel-discuss@...
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

------------------------------------------------------------------------------

_______________________________________________
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: install of open babel for pymol under window 10 - BABEL_DATADIR issues??

eolmon
I corresponded with Osvaldo, and he suggested the following:

Use Python 2.7 (64 bits) from Windows x86-64 MSI installer
https://www.python.org/ftp/python/2.7.12/python-2.7.12.amd64.msi

And then download the following packages from http://www.lfd.uci.edu/~gohlke/pythonlibs/:

openbabel-1.8.4-cp27-none-win_amd64.whl
numpy-1.11.2rc1+mkl-cp27-cp27m-win_amd64.whl
Pmw-2.0.1-py2-none-any.whl
pymol_launcher-1.0-cp27-cp27m-win_amd64.whl
pymol-1.8.3.2-cp27-cp27m-win_amd64.whl

Install using pip (see https://docs.python.org/2.7/installing/).

It worked for me. Note, I had been using the incentive (paid) version of Pymol. I hadn't been able to import pymol from within python, but I can now with the open-source version. It seems there are some limitations in the incentive version of Pymol.

-Eric
Loading...