[C++-sig] boost/python tutorial

Nguyen Xuan Son nguyenxuanson at gmail.com
Tue Nov 20 18:13:37 CET 2007


Hi,
after the run there are two folders created

A/       \boost\libs\python\example\tutorial\bin\msvc-
8.0\debug\threading-multi
I find:
20/11/2007  16:59    <DIR>          .
20/11/2007  16:59    <DIR>          ..
20/11/2007  13:26           406,907 hello.obj
20/11/2007  13:26               178 hello.obj.rsp
20/11/2007  13:28               535 hello_ext.exp
20/11/2007  13:28             1,752 hello_ext.lib
20/11/2007  13:28           543,744 hello_ext.pdb
20/11/2007  13:28               385 hello_ext.pyd.manifest
20/11/2007  13:28               173 hello_ext.pyd.rsp
20/11/2007  16:59                 0 list.txt
               8 File(s)        953,674 bytes
               2 Dir(s)   2,935,967,744 bytes free
B/       \boost\libs\python\example\tutorial\bin\hello.test\msvc-
8.0\debug\threading-multi
I find:
20/11/2007  17:00    <DIR>          .
20/11/2007  17:00    <DIR>          ..
20/11/2007  13:28                34 hello
20/11/2007  13:28                34 hello.output
20/11/2007  13:28                 9 hello.test
20/11/2007  17:00                 0 list.txt
               4 File(s)             77 bytes
               2 Dir(s)   2,935,959,552 bytes free

There is no lib file there.

I copy files in A/ to C:\Python24\Lib\site-packages\hello_ext and try to
launch the file hello.py localy (which i had copied to this folder as well).

So I am still stuck here. Please help me out:(
SOn


On Nov 20, 2007 2:55 PM, Scott VanSickle <Scott.VanSickle at canfieldsci.com>
wrote:

> You need to copy the generated pyd and lib files into a folder that
> corresponds to the name of your Python module under your Python root folder.
>  Note that the pyd is the DLL, the lib is the DLL's import library.  If you
> don't use namespaces, I think that the pyd and lib should be copied directly
> into your Python root folder.
>
> Create an __init__.py file in the module folder that looks something like
> this
>
> #============
> import sys
>
> sys.path.append('..\..')
>
> # this brings in the DLL (pyd)
> from _hello_ext import *
>
> #============
>
> You should then be able to import your hello_ext module in any of your
> Python code.
>
> Scott V
>
>
> From: c++-sig-bounces at python.org [mailto:c++-sig-bounces at python.org] On
> Behalf Of Nguyen Xuan Son
> Sent: Tuesday, November 20, 2007 6:06 AM
> To: c++-sig at python.org
> Subject: [C++-sig] boost/python tutorial
>
> Hi
> I run the command line to build the \boost\libs\python\example\tutorial
>
> >bjam -sPYTHON_ROOT=C:/Python24 -sPYTHON_VERSION=2.4  -sTOOLS=vc8
>
> I see that everything run correctly and I check the folder
> \boost\libs\python\example\tutorial\bin\hello.test\msvc-
> 8.0\debug\threading-multi
>
> and the output told me everything is OK. But I find no where the DLL, and
> I could not load the extension from the python command line:
> >>> import hello_ext
>
> Traceback (most recent call last):
>  File "<pyshell#0>", line 1, in -toplevel-
>    import hello_ext
> ImportError: No module named hello_ext
>
> Can someone help me out of this? I really confused.
>
> Son
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20071120/d098a6a9/attachment.htm>


More information about the Cplusplus-sig mailing list