How can I use python 2.7 for some apps, while keeping python 2.6 for the OS?
I am using CentOS6.6 (based on RHEL 6 / Fedora 12), and would like to install some recent packages such as meld 3.13, latest rabbitcvs, etc… It requires python 2.6 to run.
when I try to run meld 3.13, it says “Meld requires Python 2.7 or higher.”
I have successively installed python 2.7 following this tutorial http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/
how can I tell meld to use python2.7 ?
Advertisement
Answer
The best way to install python 2.7 on CentOS 6 for some apps only without touching the default system provided python 2.6 is to use Software Collections.
Check page of software collection python27
, it provides description how to install it and link to the package.
It works like this: the collection installs packages into separate directory tree in /opt/rh/python27
and doesn’t have any effect until it is enabled.
In your case you can create wrapper script which will run your version of meld with python27
collection. For example save following script into ~/bin/meld
:
#!/bin/bash COMMAND="/path/to/your/meld $@" scl enable python27 "$COMMAND"
Then every time you run meld command, it would be executed by python2.7 (assuming your meld is not already available in your PATH
).
See more details in Packaging Wrappers for Software Collections (while you are not packaging anything, the tip with wrapper seems to be useful in your case).