Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On linux SUSE or RedHat, how do I load Python 2.7

Can someone provide the steps needed to install python version 2.7 on SUSE and RedHat? It version that is on there is like 2.4 and I need to have it at at least 2.6 to make my script work. So after the install, I can type Python in a xTerm and get the Python 2.7 command line interface.

like image 751
Dag Avatar asked Nov 10 '10 21:11

Dag


People also ask

How do I make python2 default in Linux?

Setting python 2.6 as default on Linux 6 should already be set as the default. If it is not, choose it to be the default. From now on, running python should start version 2.6. Once you're done updating these packages, execute the commands at the top to set python2.


1 Answers

Instructions to download source and install:

https://www.python.org/download/

NOTE: You should check for the latest version of python 2.7.x, as it gets updated frequently. Currently (Oct 2017), the latest version is 2.7.14 though this comment will get old and new versions likely will be released every 6 months or so.

wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz # Download tar xvfz Python-2.7.14.tgz # unzip cd Python-2.7.14 # go into directory ./configure make # build su # or 'sudo su' if there is no root user make altinstall 

(EDIT: make install -> make altinstall per Ignacio's comment).

like image 63
dr jimbob Avatar answered Sep 20 '22 00:09

dr jimbob