Python sys.prefix

Z

zachar

Hi All,

I need some help about my "problem":
I compiled and installed python with ./configure --prefix=/opt/pyhon2.6.4... But I have to move it to a different directory (the reason is very difficult but I must do this)... I started the interpreter from shell and I was surprised because It still worked and It changed the sys.prefix so it pointed to the correct place so the sys.path was correct.... The questions are: HOW? Is it a feature which is not documented (at least I couldn't find anything about it)?
"sys.prefix¶

A string giving the site-specific directory prefix where the platform independent Python files are installed; by default, this is the string '/usr/local'. This can be set at build time with the --prefix argument to the configure script. The main collection of Python library modules is installed in the directory prefix + '/lib/pythonversion' while the platform independent header files (all except pyconfig.h) are stored in prefix + '/include/pythonversion', where version is equal to version[:3]."

In my case, this is not correct: it looks, after I call the interpreter, something change the sys.prefix variable and point it to the right place and not to that directory which I used with the configuration script... This is very useful (I am happy because it solves one of my problems) but I am afraid of it will be do it in a different way in the future (as it is not documented).

Thanks,
Regards,
Balazs
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top