There is a python code:
test.py:
from test2 import Say Say() test2.py:
def Say(): print("Mew") And there is c ++ code:
#include <Python.h> int main(){ Py_Initialize(); // инициализация интерпретатора PyObject *obj = Py_BuildValue("s", "test.py"); FILE *file = _Py_fopen_obj(obj, "r+"); if(file != NULL) { PyRun_SimpleFile(file, "test.py"); } Py_Finalize(); return 0; } It is compiled, but when trying to execute it gives the following
File "test.py", line 1, in <module> from test2 import Say ModuleNotFoundError: No module named 'test2' What am I doing wrong, thanks in advance!