Boost logo

Boost Users :

Subject: Re: [Boost-users] importing boost-python module in python on windows
From: Nat Goodspeed (nat_at_[hidden])
Date: 2009-06-12 11:27:02


Seema Jaisinghani wrote:

> I have created an extension boost python module for C++ class,
> successfully using Visual Studio 2009, and get a shared library(.dll) as
> output.
>
> However I am having trouble importing this module in my python code. I
> have explicitly tried importing the dll as resource in an Eclipse PyDev
> project, and also set in windows PATH environment variable, the location
> for this dll. With the PATH set, I also tried import from the python
> shell, but no success.
>
> Can someone describe what is the process to import boost_python_modules
> in python on windows.

Change your shared library's filename extension from .dll to .pyd. As of
Python 2.5, the Python interpreter stopped accepting .dll as a valid
extension module filename:

http://www.python.org/doc/2.5.4/whatsnew/ports.html#SECTION0001510000000000000000

"Windows: .dll is no longer supported as a filename extension for
extension modules. .pyd is now the only filename extension that will be
searched for."


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