How would you install Python 2.7.1 without blowing up cPanel and WHM. Is there step by step instructions on how to do this?
How would you install Python 2.7.1 without blowing up cPanel and WHM. Is there step by step instructions on how to do this?
Are you going to be using Mailman on the machine? I wouldn't suggest changing Python if you are using Mailman on the machine.
Additionally, yum relies on Python. If you end up changing the needed Python version to use yum and then break yum, your system won't be able to update system packages at that point.
Those are just a few points to keep in mind. Given those caveats, I'm a bit leery of providing details on how to update Python, since I'd then be responsible for Mailman and (more importantly) yum possibly breaking.
Is there a specific reason you'd like to update Python?
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket
Yes, I need to run python >= 2.5 for some scripts. Is it not possible to install a different version of Python into a different directory so as to avoid messing up cPanel.
BTW Python 2.4 is circa 2005, so I don't think it's unreasonable to think that users of cPanel might want to have a more recent version available to them. 6 year old software is pretty stale. My version of WHM is showing Python 2.4.3 as the installed version.
WHM 11.30.0 (build 32)
CENTOS 5.6 i686 standard
Python 2.4 is the one provided by CentOS and RHEL as the one being used by yum. This isn't a cPanel issue for the version being used, it is an operating system one. We do not use newer versions than what the operating system requires since yum uses python. You can break yum functioning if python is updated as I already mentioned.
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket
Hello,
You may go through the below URL, that has some patched RPMs
RHEL5 / CentOS5 RPMs for Python 2.5 and 2.6 | The Second Order Effect
PS. test things before implementing it on a production server
Thank you.
I agree 100% about testing before putting into production, since yum can break and, if yum breaks, we have a policy to not be able to assist in fixing it, since yum is part of the operating system rather than part of the control panel. Please be very aware that yum ceasing to function will break anything being able to update in the package system on the machine, including cPanel for EasyApache and other areas.
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket
Hi, here's a link that allows you to install a separate version of Python 2.7
Upgrading Python in Cpanel Servers | openhelp.net
I stopped after Make Install and did not modify anything cpanel-ish. (the link provides instructions for modifying cpanel, but I did NOT follow it that far.)
This allowed me to have a python 2.7 binary in the /usr/local/ folder which I can then modify my scripts to point to.
Given that I did not modify the underlying python or any of the cpanel stuff on the link provided, I think I should still be okay as typing "python -V" still gives me "Python 2.4.3". In order to access 2.7 I have to use the following:
/usr/local/python.2.7/bin/python -V
Which gives "Python 2.7"
Yum still appears to be working.
yum --version
3.2.22
Installed: rpm-4.4.2.3-22.el5.i386 at 2011-05-03 06:20
Built : [] at 2011-03-06 03:50
Committed: Jindrich Novy <jnovy@redhat.com> at 2010-11-16 22:00
Installed: yum-3.2.22-33.el5.centos.noarch at 2011-05-03 06:21
Built : [] at 2011-01-31 23:12
Committed: Karanbir Singh <kbsingh@centos.org> at 2011-01-31 22:00
Installed: yum-metadata-parser-1.1.2-3.el5.centos.i386 at 2010-10-30 12:23
Built : [] at 2009-08-27 16:20
Committed: James Antill <james.antill@redhat.com> at 2009-04-06 22:00
YMMV
cPanel installs python using yum/rpm which will be installed in /usr/bin (run which python). You can check this by running. You can install a different version of python using source by following the steps provided by filmotheklown . You can configure python through source installation by specifying prefix like /usr/local/bin/python. eg :Code:rpm -qa python. Later you can mention this python interpreter in your script to use this version.Code:./configure --prefix=/usr/local/bin/python
.
It's really easy to install a separate python without disturbing the system python. The bundled one is so old that the next version of Django won't even support it! Just download the python source from python.org into /usr/local/src and run as root:
./configure
./make install
You'll end up with python2.7 in /usr/local/bin . You can then put this in your profile:
PATH=/usr/local/bin:$PATH:$HOME/bin
so that the new version is seen by the shell before the system version. Likewise, if you need to compile mod_wsgi, configure it to use the newer version.
I just got things up and running with python2.7 and mod_wsgi being properly compiled with an easy_apache module. All dialed in for WHM/cPanel. Wrote it up here:
Building mod_wsgi through EasyApache for WHM/cPanel systems
Hope someone finds it useful!