When I type “python” in command line, it says:
Python 2.4.3 (#1, Dec 11 2006, 11:39:03)
[GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2
But I have an application that uses Python 2.7 on the same machine. How come this application is using python 2.6.5 although shell writes “2.4.3” when I type “python”?
It’s using some other Python binary, possibly one it installed. This may or may not be easily accessible to you without changing your path variable.
For example, the company I work for (Tecplot) ships a complete Python distribution with our flagship product (Tecplot 360), because of all the support headaches involved in trying to let users use whatever version of Python is installed on their machine. Worse, their machine may be locked down and they might not even be able to choose what version of Python they use. By providing our own Python binaries, we know what version the customer will be using, and we can test that it works before shipping.
If you dig around in the application’s install directory, you can probably find out where they stashed their Python executable. Most likely it can be run without the application if you know where it is, and you can probably install additional modules there if you can find a
site-packagesdirectory (and have appropriate permissions). Try doingecho $pathfrom a shell opened up from the application, if that’s possible, to get a list of the directories you should look in, or in Python, doimport sys; print sys.executable.