when im running C code to call python functions, there's error on Py_Initialize() The error is ImportError: No module named site. Ive tried to put Py_SetProgramName(argv[0]) but it doesnt work. The cmd call is cInterfacePython Test.py multiply 3 2 (exe is cInterfacePython)
I was having the same problem (Windows, both with Visual Studio and MinGW/g++), and I solved it by adding to PYTHONPATH the path to site.py.
For some reason, launching python.exe was possible even without it, and sys.path did contain that path (even when PYTHONPATH did not), and I could "import site", but Py_Initialize was not able to do the same thing that python.exe did.
embedding python error on initialization