Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python error when runs in chroot

I try to run some Python programs in chroot and I get the following error

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

I used ldd to find the libraries on which the python runtime depends and copied the inside the jail. Could you please help me with that?

Thank you

like image 775
Paris Avatar asked Sep 12 '25 04:09

Paris


1 Answers

You'll want to grab files from /usr/lib/pyshared and /usr/lib/python{$version} and copy them into your chroot.

Paths may be slightly different, you can try an strace python to see what its trying to load up.

like image 66
Null Avatar answered Sep 14 '25 19:09

Null