Is there a way to tell Python about additional site-packages
locations without modifying existing scripts?
On my CentOS 5.5 server I have a Python 2.7 i
You can use the Site-specific configuration hook.
"A path configuration file is a file whose name has the form
name.pth
and exists in one of the four directories mentioned above; its contents are additional items (one per line) to be added tosys.path
."
In your case, you should be able to achieve what you want by simply dropping in a .pth
file containing the path of the directory to include:
[root@home]$ echo "/usr/local/lib/python2.7/site-packages/" > /opt/python2.7.2/lib/python2.7/site-packages/usrlocal.pth
You could replace the python executable with a wrapper script which appends your added installpath to PYTHONPATH. But this is a kludge.
But I'd try to fix the installation of the add-on so that it properly goes into the site-packages dir.