Ubuntu系统下编译.so文件报错:undefined symbol: _Py_ZeroStruct

1.报错如下:

ImportError: /home/yang/Documents/model/detect/PSENet-master/pse/adaptor.so: undefined symbol: _Py_ZeroStruct

一般来说是编译环境版本不对应的问题。

于是修改pse/include/pybind11/detail/common.h中的第112~114:

#include <python2.7/Python.h>

#include <python2.7/frameobject.h>

#include <python2.7/pythread.h>

为:

#include <python3.5/Python.h>

#include <python3.5/frameobject.h>

#include <python3.5/pythread.h>
 

猜你喜欢

转载自blog.csdn.net/u011489887/article/details/89329750
今日推荐