Two problems: 1. When you set PYTHONPATH, don't use quotation marks. 2. On Linux, for .so files to be found, you need to add the folder to the LD_LIBRARY_PATH. So "export LD_LIBRARY_PATH=/public/home/zhengyh/usr/openbabel/lib:$LD_LIBRARY_PATH"
Should work then... - Noel On 25 October 2013 09:26, Zhengyh <swanboi...@gmail.com> wrote: > Greetings, > I was compiling the openbabel 2.3.1 version with binding for Python on 'Red > Hat Enterprise Linux Server release 5.6 (Tikanga)' . > I installed openbabel locally and this is the path below: > > babel: '/public/home/zhengyh/usr/openbabel/bin/babel' > Python binding: > '/public/home/zhengyh/usr/openbabel/lib64/python2.4/site-packages/' > > > > I appended the Python binding path to $PYTHONPATH as the doc tells but it > did not work when I imported openbabel in Python: > > In .bashrc : > > PYTHONPATH="/public/home/zhengyh/usr/openbabel/lib:/public/home/zhengyh/usr/openbabel/lib64/python2.4/site-packages:$PYTHONPATH" > > But: > >>>> import openbabel > Traceback (most recent call last): > File "<stdin>", line 1, in ? > ImportError: No module named openbabel >>>> > > > And again I did this in another scheme: > >>>> import sys,pprint >>>> pprint.pprint(sys.path) > ['', > '/usr/lib64/python24.zip', > '/usr/lib64/python2.4', > '/usr/lib64/python2.4/plat-linux2', > '/usr/lib64/python2.4/lib-tk', > '/usr/lib64/python2.4/lib-dynload', > '/usr/lib64/python2.4/site-packages', > '/usr/lib64/python2.4/site-packages/Numeric', > '/usr/lib64/python2.4/site-packages/PIL', > '/usr/lib64/python2.4/site-packages/gtk-2.0', > '/usr/lib/python2.4/site-packages'] >>>> >>>> sys.path.append('/public/home/zhengyh/usr/openbabel/lib64/python2.4/site-packages') >>>> import openbabel > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File > "/public/home/zhengyh/usr/openbabel/lib64/python2.4/site-packages/openbabel.py", > line 47, in ? > import _openbabel > ImportError: libopenbabel.so.4: cannot open shared object file: No such file > or directory >>>> sys.path.append('/public/home/zhengyh/usr/openbabel/lib') >>>> import openbabel > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File > "/public/home/zhengyh/usr/openbabel/lib64/python2.4/site-packages/openbabel.py", > line 47, in ? > import _openbabel > ImportError: libopenbabel.so.4: cannot open shared object file: No such file > or directory >>>> pprint.pprint(sys.path) > ['', > '/usr/lib64/python24.zip', > '/usr/lib64/python2.4', > '/usr/lib64/python2.4/plat-linux2', > '/usr/lib64/python2.4/lib-tk', > '/usr/lib64/python2.4/lib-dynload', > '/usr/lib64/python2.4/site-packages', > '/usr/lib64/python2.4/site-packages/Numeric', > '/usr/lib64/python2.4/site-packages/PIL', > '/usr/lib64/python2.4/site-packages/gtk-2.0', > '/usr/lib/python2.4/site-packages', > '/public/home/zhengyh/usr/openbabel/lib64/python2.4/site-packages', > '/public/home/zhengyh/usr/openbabel/lib'] > > It seems that openbabel.py could not find libopenbabel.so.4 in the > convention place. > > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss