[C++-sig] Re: importing module

Joel de Guzman djowel at gmx.co.uk
Tue Jul 22 00:23:33 CEST 2003


"David Abrahams" <dave at boost-consulting.com> wrote in message
news:uvftwuejs.fsf at boost-consulting.com
> The following message is a courtesy copy of an article
> that has been posted to gmane.comp.python.c++ as well.
>
> Mattheos Kakaris <m.kakaris at nki.nl> writes:
>
>> while running bjam in the boost_1_30_0/libs/python/example/tutorial
>> folder for the hello.cpp example it creates the following directory
>> structure:
>> /bin/hello.so/gcc/debug/runtime-link-dynamic/shared-linkable-true
>>
>> When running Python and trying to import module hello, it rightfully gives
>> the message:
>> ImportError: No module named hello
>>
>> What should I do so that python will always know were to look for
>> the module?
>
> You can set your PYTHONPATH environment variable to contain the
> directory where the module is created, or you can add the following
> line to your Jamfile:
>
>      stage . : hello ;
>
> and it will be copied into the current directory.
>
> Joel, you probably ought to add this stage line to the tutorial, eh?

Ok, great. Thanks.

--
--
Joel de Guzman
joel at boost-consulting.com
http://www.boost-consulting.com
http://spirit.sf.net







More information about the Cplusplus-sig mailing list