Embedded Python Requirements

Eric Shorkey eshorkey at rightbracket.com
Wed Mar 20 16:22:32 EST 2002


I'm having a little trouble making a self reliant embedded build of
python.
I've looked at Demos/embed/demo.c, and I understand it just fine, but
the python interpretter is generating errors on startup.

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

This occurs seemingly regardless of how I build libpython2.2.a.
>From searching previous posts, I'm able to remove the first three
lines by simply setting PYTHONHOME in the environment. It doesn't
matter whether the path is valid or not. Alternatively I could
redefine my own Py_GetPath() Py_GetPrefix() Py_GetExecPrefix() and
Py_GetProgramFullPath(). I probably will do just that. So these are
not really the problem.

It's the last error that really has me baffled. I understand that the
site module is always imported when the interpreter starts, but I
really need to build my app completely self sufficient. So the site
module will either have to be statically included, or it's necessity
will have to be removed.

Is it possible to statically link in the site module? And what exactly
does the site module provide that is so important that it is included
by default? I'd like to know, because I may be able to simply do away
with it.

Thanks!



More information about the Python-list mailing list