Invoking Python script inside MainComponent with the chance to store its output

Hello everyone.
I have a Python script which is in charge to give me as an output a list of strings after exploiting several Python libraries.

I would like to launch this script inside Juce and store the output inside a variable. I tried to implement my own code by following an old thread (https://forum.juce.com/t/launch-python-script-from-juce/42967).

#include "MainComponent.h"

#ifdef _DEBUG
    #define _DEBUG_WAS_DEFINED
    #undef _DEBUG
#endif
#include <Python.h>
#ifdef _DEBUG_WAS_DEFINED   
    #define _DEBUG
    #undef _DEBUG_WAS_DEFINED
#endif

MainComponent::MainComponent()
{
    pythonFile.getChildFile("hello.py");

    FILE* pyFile;
    Py_Initialize();
    PyRun_SimpleFile(pyFile, pythonFile.getFullPathName().toRawUTF8());
}

However, the code does not work. I’m trying to follow the instructions written here: https://docs.python.org/3/extending/embedding.html, but unfortunately I’m getting nowhere.

Any suggestions?

Brief update:
after adding my lib and include path of Python inside Exporters → Visual Studio Code → Debug and inside Exporters → Visual Studio Code → Release, I’m able to simply declare #include <Python.h>

After several attempts, I’m trying to implement something with the pybind11 library.

#include <pybind11/embed.h>
#include <pybind11/pybind11.h>
namespace py = pybind11;

MainComponent::MainComponent()
{
    auto math = py::module::import("math");
    auto resultobj = math.attr("sqrt")(2);
    double result = resultobj.cast<double>();
}

However, I get the following error:

_PyRuntime.gc.**generation0** was nullptr.

Did you ever get anywhere with this? I’m currently trying the same thing without any luck.