Hi all, I'm trying to get the boost.python tutorial working. The hello.py example builds successfully. The problem is, when i run my python file, there is an error: Evaluating hello.py Traceback (most recent call last): File "<string>", line 6, in <fragment> ImportError: No module named hello_ext Now, the tutorial directory has the python and c++ file, and a bin directory. the bin directory is as follows : tutorial\bin\msvc-9.0\debug\threading-multi the hello_ext.pyd file is located inside here. Can anyone help? Its a path problem i believe, but i'm not able to pin point whats wrong. -- Regards, Hitesh Dhiman Electrical Engineering National University of Singapore
hitesh dhiman wrote:
Hi all, I'm trying to get the boost.python tutorial working. The hello.py example builds successfully. The problem is, when i run my python file, there is an error:
Evaluating hello.py Traceback (most recent call last): File "<string>", line 6, in <fragment> ImportError: No module named hello_ext
Now, the tutorial directory has the python and c++ file, and a bin directory. the bin directory is as follows : tutorial\bin\msvc-9.0\debug\threading-multi the hello_ext.pyd file is located inside here.
Can anyone help? Its a path problem i believe, but i'm not able to pin point whats wrong.
Hello, the only experience I have is on a Linux platform, where a shared library hello_ext.so should be created. After this, from python do a 'import hello_ext' to get access to the class and get it working as advertised. Kind regards, Rutger
Hi,
I managed to get it working, by following the link:
http://selcuk-ozturk.com/post/2009/09/15/C2b2b-and-Python-with-BoostPython-1...
http://selcuk-ozturk.com/post/2009/09/15/C2b2b-and-Python-with-BoostPython-1...Basically,
during the test mode, bjam deletes the pyd file. I had to use
--preserve-test-targets
and then it retained the pyd file.
After that i copied the dll from the bin.v2 folder to this folder, and it
worked.
Thanks for the help!
On Wed, Feb 17, 2010 at 4:09 PM, Rutger ter Borg
hitesh dhiman wrote:
Hi all, I'm trying to get the boost.python tutorial working. The hello.py example builds successfully. The problem is, when i run my python file, there is an error:
Evaluating hello.py Traceback (most recent call last): File "<string>", line 6, in <fragment> ImportError: No module named hello_ext
Now, the tutorial directory has the python and c++ file, and a bin directory. the bin directory is as follows : tutorial\bin\msvc-9.0\debug\threading-multi the hello_ext.pyd file is located inside here.
Can anyone help? Its a path problem i believe, but i'm not able to pin point whats wrong.
Hello,
the only experience I have is on a Linux platform, where a shared library hello_ext.so should be created. After this, from python do a 'import hello_ext' to get access to the class and get it working as advertised.
Kind regards,
Rutger
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Regards, Hitesh Dhiman Electrical Engineering National University of Singapore
hitesh dhiman wrote:
Hi, I managed to get it working, by following the link: http://selcuk-ozturk.com/post/2009/09/15/C2b2b-and-Python-with-BoostPython-1...
http://selcuk-ozturk.com/post/2009/09/15/C2b2b-and-Python-with-BoostPython-1...Basically, during the test mode, bjam deletes the pyd file. I had to use --preserve-test-targets
You must be using an old version of Boost. 1.42 does not delete any test targets, for all I can tell. - Volodya
Hmm...that's wierd, because earlier the folder only had one pyd file, listed
as a RSP file. On doing this, there was another pyd file, listed as PYD.
After copying this pyd the program worked.
On Wed, Feb 17, 2010 at 4:32 PM, Vladimir Prus
hitesh dhiman wrote:
Hi, I managed to get it working, by following the link:
http://selcuk-ozturk.com/post/2009/09/15/C2b2b-and-Python-with-BoostPython-1...
<
http://selcuk-ozturk.com/post/2009/09/15/C2b2b-and-Python-with-BoostPython-1...
Basically, during the test mode, bjam deletes the pyd file. I had to use --preserve-test-targets
You must be using an old version of Boost. 1.42 does not delete any test targets, for all I can tell.
- Volodya
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Regards, Hitesh Dhiman Electrical Engineering National University of Singapore
participants (3)
-
hitesh dhiman
-
Rutger ter Borg
-
Vladimir Prus