I am running a C ++ application that is trying to start python using function calls https://docs.python.org/3.5/extending/embedding.html . This is the error that application error message channels give me.
class 'ImportError': Failed to import an extension module with multiple arrays. Most likely you are trying to import a failed numpy build. If you work with git clean -xdfgit, try git clean -xdf(deletes all files that are not under version control). Otherwise reinstall NumPy.
Initial error: /usr/local/lib/python3.5/site-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so: undefined character: PyExc_UserWarning
I am very puzzled since this only happens when embedding Python in C ++, since importing works when I use it through an interpreter. I'm more interested in an answer that adds to my understanding than a quick execution or fix. I list some system / problem information below and some other questions that I am going to post on the same topic. Any guidance is appreciated!
System / Problem Information:
/ NUMPY , , .
, , - . , numpy Python C++; , , , , . , , , , , . , , / ( , ).
- multiarray.so pythonX.X.so ? , , - .
- CMake , , , 4/12/18 16/16/18.
- PYTHONPATH .bashrc, , , Py_GetPath(), sys.path. bash, C++.
, , .
, , . .
: 17.04.18:
, , . , / , . Numpy, , - . , - . , . , pythonInterface.cpp:
#include <dlfcn.h>dlopen("libpython3.5m.so.1.0", RTLD_LAZY | RTLD_GLOBAL)
, cpython.multiarray.so.
, .so, . , , python, pythonInterface.so , . , , , . !