I recently needed a static version of python in one of my projects, so i got the source and built it. After linking it to my application when I run it I am missing all of the required modules and I don't know where to put them.
Errors:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named time
Code:
#include <Python.h>
int main(int argc, char *argv[])
{
Py_SetProgramName(argv[0]); /* optional but recommended */
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}
Code for building exe:
gcc main.c -I/Desktop/Python-2.6.4 -I//Desktop/Python-2.6.4/Include -I/Desktop/Python-2.6.4/Modules -L/Desktop/Python-2.6.4 -lpython2.6 -static
Tutorial for building python statically
If someone could tell me where to put these modules or even better tell me how to link them statically, it would be much appreciated!