开发者

Importing with boost python

开发者 https://www.devze.com 2023-03-12 20:19 出处:网络
Whether I import like this: numpy_module = bp::import(\"开发者_Go百科numpy\"); or like this: numpy_module = bp::scope().attr(\"numpy\");

Whether I import like this:

numpy_module = bp::import("开发者_Go百科numpy");

or like this:

numpy_module = bp::scope().attr("numpy");

I get

terminate called after throwing an instance of 'boost::python::error_already_set'

I didn't have a problem with Python 2.7, but after upgrading to Python 3.1, this strange exception crops up.


Got it: I needed to compile Boost for Python31.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号