After testing it out on your system, it seems to be that "make
install" fails if using EIGEN2 and the Python bindings (this is
already reported at
http://sourceforge.net/tracker/?func=detail&aid=3399341&group_id=40728&atid=428742).
I need to fix this.

If not using Eigen2, then it all works fine for me with the system
python (python2.6) and swig:

cmake ../trunk -DCMAKE_INSTALL_PREFIX=`pwd`/../install
-DPYTHON_BINDINGS=ON -DEIGEN2_INCLUDE_DIR= -DRUN_SWIG=ON

After make && make install, I defined
LD_LIBRARY_PATH=`pwd`/install/lib and
PYTHONPATH=`pwd`/install/lib/python2.6/site-packages, then "import
pybel" worked fine.

- Noel

> 2) I added the local python libraries folder to LD_LIBRARY_PATH (I had
> previously added the local OpenBabel path)
>
> 3) I modified all the relevant lines at  CMakeCache.txt in the build
> directory
> 4) Then  "touch openbabel-python.i" and, just in case,  "touch
> scripts/openbabel-python.i"
>
> 5) I recompiled and reinstalled and it seems that now it is using the local
> installation.
>
> 6) Yet:
>
> Python 2.7.2 (default, Sep 15 2011, 12:37:05)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import openbabel
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/home/mirix/python/lib/python2.7/site-packages/openbabel.py", line
> 212, in <module>
>    _openbabel = swig_import_helper()
>  File "/home/mirix/python/lib/python2.7/site-packages/openbabel.py", line
> 208, in swig_import_helper
>    _mod = imp.load_module('_openbabel', fp, pathname, description)
> ImportError: dynamic module does not define init function (init_openbabel)
>>>>
>
>
> On 09/15/2011 12:16 PM, Noel O'Boyle wrote:
>>
>> One Python is 2.6, the other is 2.7. You need to decide which you want
>> to use as you can't compile against 2.7 and then use the 2.6 one. Can
>> you check all Python related variables in CMakeCache to see whether
>> they point to the version you want to use (and then "touch
>> openbabel-python.i" and recompile)?
>>
>> - Noel
>>
>> On 15 September 2011 11:05, Miro Moman<miromo...@gmail.com>  wrote:
>>>
>>> Debian 6.0.2 64-bit.
>>>
>>> Yes, I have OpenBabel installed globally using apt-get because there are
>>> several packages that depend on it. I also have it locally. PYTHONPATH
>>> now
>>> points to the locally installed version, but I was getting the same error
>>> before defining the environmental variable PYTHONPATH. In fact, I
>>> performed
>>> a local install because I was having problems with the global one. The
>>> program is running fine (both versions). The only problem appears to be
>>> the
>>> Python bindings.
>>>
>>> The local installation:
>>>
>>> mirix@aeolux:~/openbabel/bin$ ../../python/bin/python2.7
>>> Python 2.7.2 (default, Sep 14 2011, 12:28:39)
>>> [GCC 4.4.5] on linux2
>>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>>
>>>>>> import openbabel
>>>
>>> Traceback (most recent call last):
>>>  File "<stdin>", line 1, in<module>
>>>  File "/home/mirix/python/lib/python2.7/site-packages/openbabel.py", line
>>> 170, in<module>
>>>    _openbabel = swig_import_helper()
>>>  File "/home/mirix/python/lib/python2.7/site-packages/openbabel.py", line
>>> 166, in swig_import_helper
>>>    _mod = imp.load_module('_openbabel', fp, pathname, description)
>>> ImportError: dynamic module does not define init function
>>> (init_openbabel)
>>> [2]+  Stopped                 ../../python/bin/python2.7
>>>
>>> The global installation
>>>
>>> mirix@aeolux:~/openbabel/bin$ python
>>> Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
>>> [GCC 4.4.5] on linux2
>>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>>
>>>>>> import openbabel
>>>
>>> Traceback (most recent call last):
>>>  File "<stdin>", line 1, in<module>
>>>  File "/home/mirix/python/lib/python2.7/site-packages/openbabel.py", line
>>> 170, in<module>
>>>    _openbabel = swig_import_helper()
>>>  File "/home/mirix/python/lib/python2.7/site-packages/openbabel.py", line
>>> 166, in swig_import_helper
>>>    _mod = imp.load_module('_openbabel', fp, pathname, description)
>>> ImportError: dynamic module does not define init function
>>> (init_openbabel)
>>> [3]+  Stopped                 python
>>>
>>>
>>>
>>>
>>> On 09/15/2011 11:55 AM, Noel O'Boyle wrote:
>>>>
>>>> On 15 September 2011 10:37, Miro Moman<miromo...@gmail.com>    wrote:
>>>>>
>>>>> So, I do not understand what is wrong. Is this a bug?
>>>>
>>>> What operating system? Do you have other versions of Open Babel
>>>> installed. Also, what is the result of testing the installation as
>>>> described in the install instructions:
>>>>
>>>>
>>>> http://openbabel.org/docs/current/UseTheLibrary/PythonInstall.html#test-the-installation
>>>>
>>>> - Noel
>>>
>
>

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to