Boost logo

Boost Users :

From: Trevor M Cickovski (tcickovs_at_[hidden])
Date: 2006-06-29 13:08:09


Hello,
I am trying to run some embedded Python code, following the boost.Python
tutorial. What I was hoping to do was import some external modules. So
basically in my .cpp file I have:

    Py_Initialize();

    object main_module((
            handle<>(borrowed(PyImport_AddModule("__main__")))));
    object main_namespace = main_module.attr("__dict__");

    try{
    handle<> ignored((PyRun_String( "import Numeric\n"
                                     // Other Python commands
                  , Py_file_input
                  , main_namespace.ptr()
                  , main_namespace.ptr())
));
    }
    catch(error_already_set)
      {
    PyErr_Print();
      }

    // Finish the Python Interpreter
    Py_Finalize();

However when I 'import Numeric', I get an undefined symbol:
Traceback (most recent call last):
  File "<string>", line 4, in ?
  File
"/afs/nd.edu/user25/tcickovs/Research/PYTHON/lib/python2.4/site-packages/Numeric/Numeric.py",
line 91, in ?
    import multiarray
ImportError:
/afs/nd.edu/user25/tcickovs/Research/PYTHON/lib/python2.4/site-packages/Numeric/multiarray.so:
undefined symbol: PyExc_ValueError

Now if I just run python from the command line and call 'import Numeric'
everything is fine. Does anyone have any idea what I need to do
differently if I use Boost?

Thanks for the help,
Trevor

-- 
-------------------------------------------------------
This is your time, this is your dance
Live every moment, leave nothing to chance.
Swim in the sea, drink of the deep
Embrace the mystery of all you can be.
- Michael W. Smith, "This Is Your Time"

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