1

I'm trying to run the hello world boost python example and at first glance everything seems fine. I'm getting the following output

>bjam
...patience...
...patience...
...found 1727 targets...
...updating 9 targets...
gcc.compile.c++ bin/gcc-4.7/debug/hello.o
gcc.link.dll bin/gcc-4.7/debug/hello_ext.so
common.copy libboost_python.so.1.53.0
ln-UNIX libboost_python.so
ln-UNIX libboost_python.so.1
ln-UNIX libboost_python.so.1.53
common.copy hello_ext.so
capture-output bin/hello.test/gcc-4.7/debug/hello
**passed** bin/hello.test/gcc-4.7/debug/hello.test
...updated 9 targets...

However, when I try to use it in python I get an import error message

>python
Python 2.7.4 (default, Apr 19 2013, 18:32:33) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "hello.py", line 6, in <module>
  import hello_ext
ImportError: libboost_python.so.1.53.0: cannot open shared object file: No such file or directory
0

1 Answer 1

1

You need to configure your environment to find the boost libraries. This does not have much to do with python, but with the boost installation. The quickest way is to extend the LD_LIBRARY_PATH environment variable.

Have a look here:

Error loading shared libraries of boost

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.