Embedded Python static modules

  • Thread starter Евгений Почитаев
  • Start date
Ð

Евгений Почитаев

I build python from sources(static version):
../configure --disable-shared
Next I build program with this static library. Program work fine on my
linux, but when I tried run my program on another linux, I got next
message:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
This message I receive when call Py_Initialize().
How I can build python static library with all required Python
modules?
Thanks.
 
Ð

Евгений Почитаев

I made frozen modules and link this modules with my program.
PyImport_FrozenModules = frozen_modules;
Py_Initialize();
I got next message:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "site.py", line 553, in <module>
File "site.py", line 535, in main
File "site.py", line 268, in addusersitepackages
File "site.py", line 243, in getusersitepackages
File "site.py", line 233, in getuserbase
File "sysconfig.py", line 535, in get_config_var
File "sysconfig.py", line 434, in get_config_vars
File "sysconfig.py", line 287, in _init_posix
IOError: invalid Python installation: unable to open /usr/local/lib/
python2.7/config/Makefile (No such file or directory)
How I can fix this problem?
 
Ð

Евгений Почитаев

I found solution:
Py_NoSiteFlag = 1;
Py_FrozenFlag = 1;
Py_IgnoreEnvironmentFlag = 1;
Py_SetPythonHome("");
Py_SetProgramName("");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top