Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2007-08-13 19:24:38


on Mon Aug 13 2007, desai3-AT-cooper.edu wrote:

> Hi all:
>
> I am completely new to Python and Boost.python. (I have been using it for
> two days)
>
> I was trying out a tutorial example that is located in the
> boost_1_34_1\libs\example\tutorial folder of the standard Boost

boost_1_34_1\libs\python\example\tutorial

> distribution.
>
> After running ./Bjam target-os=cygwin toolset = gcc it created hello.dll,
> hello.dll.a and hello.o files in
> boost_1_34_1\libs\python\example\tutorial\bin\gcc-3.4.4\debug.
>
> However, when I go to python and use "import python" it gives me following
> error
>
> ########################################
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named hello
> ########################################
>
> What am I doing wrong? I am completely new to this boost and python so
> simplified answers will help a lot.

Did you follow this part of the instructions at
http://boost.org/libs/python/doc/tutorial/doc/html/python/hello.html:

  After a successful build, you make it possible for the system to
  find boost_python.dll or libboost_python.so (usually done with
  LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or some other variable on *nix
  and with PATH on Windows) and for Python to find the hello module
  (Done with PYTHONPATH on all systems.)

??

If you don't know what that means, I suggest you follow
http://boost.org/libs/python/doc/building.html instead. In
http://boost.org/libs/python/doc/building.html#basic-procedure, one
command will build *and* test a Python extension module for you. If
you add -d+2 to your bjam command line, you can see everything that
the system does to make that happen.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
The Astoria Seminar ==> http://www.astoriaseminar.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net