On Redhat, python 2.4.3 is installed. On that machine, we have an application that uses python 2.6 (strange, at least for me).
I understand it this way:
I start a command line from RedHat desktop and type “python”, it says:
Python 2.4.3 (#1, Dec 11 2006, 11:39:03)
Within the application I mentioned above, I can start an xterm, and when I type “python” there, it says:
Python 2.6.5 (r265:79063, Sep 27 2010, 19:19:43)
Now, PYTHONPATH of RedHat and PYTHONPATH of this application is different than each other.
I want to add a new directory to the PYTHONPATH of this application. How can I find where its PYTHONPATH is defined? And how do I add a new directory to this application’s PYTHONPATH?
the application might be running inside some python virtual environment.
You should focus your research trying to find out which python is being used when you run python. You can do it using the which comamand.
The both values will be definitely different.
Now, before adding a new path to the app PYTHONPATH you should ask before why you need it. If you only need a python module it might be better to just install it from pip.
If you still need to do it you can do it with the python site. Have you look on it has your answer. http://docs.python.org/library/site.html