import extension module in python on OSX
Hello, I've compiled the example code for Boost.Python: #include <boost/python.hpp> char const* greet() { return "hello, world"; } BOOST_PYTHON_MODULE(hello_ext) { using namespace boost::python; def("greet", greet); } It compiles and I got an BoostPythonTest.dylib produced by Xcode. I've tried to put that file in my site-packages folder and som other places in order to import it into the interpreter like: import BoostPythonTest Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'BoostPythonTest'
I've tried to rename it to BoostPythonTest.so and .pyd and so on: But it doesn't work. What is the proper extension name for boost python modules on OSX? I'm using boost 1.53, OSX 1.8 and Python 3.2
Thanks in advance, Simon
why didn't you follow the example to the end? Your module is called 'hello_ext'. 2013/9/10 Simon W <simwarg@gmail.com>:
Hello,
I've compiled the example code for Boost.Python:
#include <boost/python.hpp>
char const* greet()
{
return "hello, world";
}
BOOST_PYTHON_MODULE(hello_ext)
{
using namespace boost::python;
def("greet", greet);
}
It compiles and I got an BoostPythonTest.dylib produced by Xcode. I've tried to put that file in my site-packages folder and som other places in order to import it into the interpreter like:
import BoostPythonTest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'BoostPythonTest'
I've tried to rename it to BoostPythonTest.so and .pyd and so on: But it doesn't work. What is the proper extension name for boost python modules on OSX? I'm using boost 1.53, OSX 1.8 and Python 3.2
Thanks in advance, Simon
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org https://mail.python.org/mailman/listinfo/cplusplus-sig
participants (2)
-
Simon W -
Wojciech Mamrak