Install python 2.6 in CentOS

I have a shell that runs CentOS.

For a project I'm doing, I need python 2.5+, but centOS is pretty dependent on 2.4.

From what I've read, a number of things will break if you upgrade to 2.5.

I want to install 2.5 separately from 2.4, but I'm not sure how to do it. So far I've downloaded the source tarball, untarred it, and did a ./configure --prefix=/opt which is where I want it to end up. Can I now just make, make install ? Or is there more?


Asked by: Madaline416 | Posted: 06-12-2021






Answer 1

You could also use the EPEL-repository, and then do sudo yum install python26 to install python 2.6

Answered by: Emily737 | Posted: 07-01-2022



Answer 2

Try epel

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
sudo rpm -ivh epel-release-5-4.noarch.rpm
sudo yum install python26

The python executable will be available at /usr/bin/python26

mkdir -p ~/bin
ln -s /usr/bin/python26 ~/bin/python
export PATH=~/bin:$PATH # Append this to your ~/.bash_profile for persistence

Now, python command will execute python 2.6

Answered by: Steven196 | Posted: 07-01-2022



Answer 3

When I've run into similar situations, I generally avoid the package manager, especially if it would be embarrassing to break something, i.e. a production server. Instead, I would go to Activestate and download their binary package:

https://www.activestate.com/activepython/downloads/

This is installed by running a script which places everything into a folder and does not touch any system files. In fact, you don't even need root permissions to set it up. Then I change the name of the binary to something like apy26, add that folder to the end of the PATH and start coding. If you install packages with apy26 setup.py installor if you use virtualenv and easyinstall, then you have just as flexible a python environment as you need without touching the system standard python.

Edits... Recently I've done some work to build a portable Python binary for Linux that should run on any distro with no external dependencies. This means that any binary shared libraries needed by the portable Python module are part of the build, included in the tarball and installed in Python's private directory structure. This way you can install Python for your application without interfering with the system installed Python.

My github site has a build script which has been thoroughly tested on Ubuntu Lucid 10.04 LTS both 32 and 64 bit installs. I've also built it on Debian Etch but that was a while ago and I can't guarantee that I haven't changed something. The easiest way to do this is you just put your choice of Ubuntu Lucid in a virtual machine, checkout the script with git clone git://github.com/wavetossed/pybuild.git and then run the script.

Once you have it built, use the tarball on any recent Linux distro. There is one little wrinkle with moving it to a directory other than /data1/packages/python272 which is that you have to run the included patchelf to set the interpreter path BEFORE you move the directory. This affects any binaries in /data1/packages/python272/bin

All of this is based on building with RUNPATH and copying the dependent shared libraries. Even though the script is in several files, it is effectively one long shell script arranged in the style of /etc/rc.d directories.

Answered by: Haris613 | Posted: 07-01-2022



Answer 4

No need to do yum or make your own RPM. Build python26 from source.

wget https://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz
tar -zxvf Python-2.6.6.tgz
cd Python-2.6.6
./configure && make && make install

There can be a dependency error use

yum install gcc cc

Add the install path (/usr/local/bin/python by default) to ~/.bash_profile.

It will not break yum or any other things which are dependent on python24.

Answered by: Elise215 | Posted: 07-01-2022



Answer 5

No, that's it. You might want to make sure you have all optional library headers installed too so you don't have to recompile it later. They are listed in the documentation I think.

Also, you can install it even in the standard path if you do make altinstall. That way it won't override your current default "python".

Answered by: Chelsea715 | Posted: 07-01-2022



Answer 6

Chris Lea provides a YUM repository for python26 RPMs that can co-exist with the 'native' 2.4 that is needed for quite a few admin tools on CentOS.

Quick instructions that worked at least for me:

$ sudo rpm -Uvh http://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm
$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CHL
$ sudo yum install python26
$ python26

Answered by: Kristian894 | Posted: 07-01-2022



Answer 7

If you want to make it easier on yourself, there are CentOS RPMs for new Python versions floating around the net. E.g. see:

http://www.geekymedia.com/python_26_centos.html

Answered by: Emily156 | Posted: 07-01-2022



Answer 8

When you install your python version (in this case it is python2.6) then issue this command to create your virtualenv:

virtualenv -p /usr/bin/python2.6 /your/virtualenv/path/here/

Answered by: Julia636 | Posted: 07-01-2022



Answer 9

Late to the party, but the OP should have gone with Buildout or Virtualenv, and sidestepped the problem completely.

I am currently working on a Centos server, well, toiling away would be the proper term and I can assure everyone that the only way I am able to blink back the tears whilst using the software equivalents of fire hardened spears, is buildout.

Answered by: Richard739 | Posted: 07-01-2022



Answer 10

you can always make your own RPM:

http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/

Answered by: Brooke184 | Posted: 07-01-2022



Answer 11

Missing Dependency: libffi.so.5 is here :

ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/libffi-3.0.5-1.el5.kb.i386.rpm

Answered by: Rafael371 | Posted: 07-01-2022



Answer 12

rpm -Uvh http://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CHL
rpm -Uvh ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/libffi-3.0.5-1.el5.kb.i386.rpm
yum install python26
python26

for dos that just dont know :=)

Answered by: Agata907 | Posted: 07-01-2022



Answer 13

# yum groupinstall "Development tools"
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel

Download and install Python 3.3.0

# wget http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
# tar xf Python-3.3.0.tar.bz2
# cd Python-3.3.0
# ./configure --prefix=/usr/local
# make && make altinstall

Download and install Distribute for Python 3.3

# wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
# tar xf distribute-0.6.35.tar.gz
# cd distribute-0.6.35
# python3.3 setup.py install

Install and use virtualenv for Python 3.3

# easy_install-3.3 virtualenv
# virtualenv-3.3 --distribute otherproject

New python executable in otherproject/bin/python3.3
Also creating executable in otherproject/bin/python
Installing distribute...................done.
Installing pip................done.

# source otherproject/bin/activate
# python --version
Python 3.3.0

Answered by: Catherine277 | Posted: 07-01-2022



Answer 14

I unistalled the original version of python (2.6.6) and install 2.7(with option make && make altinstall) but when I tried install something with yum didn't work.

So I solved this issue as follow:

  1. # ln -s /usr/local/bin/python /usr/bin/python
  2. Download the RPM package python-2.6.6-36.el6.i686.rpm from http://rpm.pbone.net/index.php3/stat/4/idpl/20270470/dir/centos_6/com/python-2.6.6-36.el6.i686.rpm.html
  3. Execute as root rpm -Uvh python-2.6.6-36.el6.i686.rpm

Done

Answered by: Julia540 | Posted: 07-01-2022



Answer 15

Type the following commands on the terminal to install Python 3.6 on CentOS 7:

$ sudo yum install https://centos7.iuscommunity.org/ius-release.rpm

Then do :

$ sudo yum install python36u 

You can also install any version instead of 3.6 (if you want to) by just replacing 36 by your version number.

Answered by: Wilson490 | Posted: 07-01-2022



Similar questions

gcc - Why can't I install Python 2.7 under Centos 5.5?

Centos 5.5 comes with python 2.4 installed, and I needed python 2.7 for a project. I downloaded the source, ran, removed, and tried again with a couple alternative builds: ./configure && make && make install ./configure && make && make altinstall ./configure --prefix=/opt/python2.7 && make && make install I proceeded to install setuptools ...


python - yum install error Centos 5

I cannot find any information regarding the issue I am having so here it is. While trying to yum install php-pear (infact running yum at all) I run into this problem: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: cannot import name canCoinstall Please install a package which provides this module, or verify that the module is inst...


python - how to install urwid 1.1.1 on CentOS 6.4?

To install urwid 1.1.1 on CentOS 6.4 I already tried: yum install python-urwid which installs urwid 0.9.9. Then I manually downloaded urwid 1.1.1 and run: cd /mnt/hgfs/Shared/urwid-1.1.1 python ./setup.py install like the online ...


How to install python for one user on centos?

I'm working a linux machine running CentOS. I don't have full sudo powers and theres multiple versions of python already installed on the machine and the whole thing is a bit of a mess, stuff like numpy doesn't work and I need to install modules which rely on that. I was wondering if its possible to just install python (and hopefully R) into my own home directory or something and then install the modules I need int...


python - Stuck when install scipy in CentOS

Environment is Python 3.5 and CentOS 7.0 in VPS (XEN). I use IUS repository for CentOS7 to install Python 3.5 and corresponding devel, setuptools packages. Then upgrade pip3.5 itself by sudo pip3.5 install upgrade pip Numpy and Matplotlib can be installed by pip 3.5 without any problem. sudo pip3.5 install numpy sudo pip3.5 install matplotlib But when I tr...


python - Cannot install pip centos 6.7

I try to install pip on my centos 6.7 computer but run into the issue below. So it seems like I have the wrong version of python. But if I check with python --version I get that I have version 2.7. So what should I do????? Kind regards, Anders [epic@localhost opt]$ sudo yum install -y python-pip [sudo] password for epic: Loaded plugins: fastestmirror, refresh-packagekit, security Setting up...


Where does yum install python on CentOS 6.6?

I've installed python27 on my CentOS 6.6 system using this command: % yum install python27 The install went successfully but I cannot find the python27 executable. It is not in the following places: /bin /usr/bin /usr/local/bin Running the yum command again tells me that there is nothing to do. [ray@localhost bin]$ sudo yum ins...


python - Install uwsgi on CENTOS 6 VPS fails with error

Just got a shiny new VPS with CENTOS 6, so I can start migrating my sites to it. Just installed Python 3.6 on it, with ./configure make make altinstall This installed pip along with it. So can install uwsgi (was trying at first in a virtualenv but lets just keep this simple now) pip install uwsgi This fails with the following: Installing c...


linux - How can I Install Python 2.6 in CentOs 7?

I Tried to install Python 2.6 in CentOs 7 with sudo yum install python26 But, getting the following error. Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: centos.excellmedia.net * epel: kartolo.sby.datautama.net.id * extras: centos.excellmedia.net * updates: centos.excellmedia.net No package python26 available. Er...


python - Can't install Keras via Git on Centos

I'm trying to find a way how to install Keras on Centos7 using Python and Git. Git Clone Install Here is the alternative install method for Keras using the GitHub source. (This assumes you have Git installed and working.) First, clone Keras using the following git command. [root@host ~]# git clone https://github.com/keras-team/keras.git Then, cd into the Keras folder and run th...


python - How can I install pyCurl?

I used libcurl with no problems and used pyCurl once in the past. Now i want to set it up on my machine and dev. However i have no idea how to do it. I rather not DL libcirl files and compile that along with pycurl, i want to know the simplest method. I have libcurl installed on my machine. I am on Windows. I tried DLing the sources and use pycurl setup script, but I had no luck.


python - where does django install in ubuntu

I am looking for the init.py file for django. I tried whereis and find, but I get a lot of dirs.


What should I install in order to be able to use GTK in Python on Ubuntu?

In my source code I have: import gtk But when I run the script with python3 script.py command I get the following error. What package should I install to get it working? Edit: my bad. here is the error: ImportError: No module named gtk Edit2: Thanks for the answer, kaizer.se. But I'm still getting an error message. Take a look at the following...


install python Mysql module

I've just installed python 2.6 on my win7 machine. Now I tried to install mysqldb. But when run "python setup.py install" C:\MySQL-python-1.2.3c1>python setup.py install Traceback (most recent call last): File "setup.py", line 15, in <module> metadata, options = get_config() File "C:\MySQL-python-1.2.3c1\setup_windows.py", line 7, in get_config serverKey = _winreg.OpenKey(_winreg....


boost - I've got Python built using VS2008, how do I install it?

I'm working with boost::python and wanted to build the whole thing to make sure I can pull it off. However, I don't see any install script or way to build the MSI so I can install it. Anyone know where the directions are? Or the projects I could use to make an MSI file? Doing this on linux seems trivial: make install How do I do this under windows


python - Error install PyGtk

I tried to install pygtk on mac. I downloaded the pygtk file, opened up terminal and set it to my working directory, then ran the command "python setup.py install". There was an import error because there was no module dsextras. Does anyone know how to install pygtk on a mac or get dsextras.


python - How do I install boto?

So that I am able to work with it within my python scripts?


python - How do I install pyCurl?

I tried everything! I cannot find a way to install pyCurl on my Windows 7 machine! I found these binaries link... BUT there are no binaries for 2.6. : ( Help would be great. : )


python - What is paster and how do I install it?

I am installing an application and have installed python and easy_install. I now have two steps to complete: 5. Make a config file as follows:: paster make-config openbiblio development.ini 6. Tweak the config file as appropriate and then setup the application:: paster setup-app config.ini I have read Stackoverflow answers and tried the web but cannot f...


How to install SSL for python 2.5 on Debian Linux?

Question How do I install SSL for Python 2.5 on Debian? I have tried: sudo easy_install ssl But getting: $ python setup.py build looking for /usr/include/openssl/ssl.h looking for /usr/include/krb5.h running build running build_py running build_ext building 'ssl._ssl2' extension creating build/temp.linux-i686-2.5 creating build/temp.linux-i686-2.5/ssl gcc ...


macos - python install on leopard

I'll admit I'm completely dumbed by python install. Can someone help me on how to install module I want to play with PyGame, PyOpenGL etc. So I install them, but I everytime I type "import pygame" error message shows up. here's my environment so far. In .bash_profile PATH=${PATH}:/System/Library/Frameworks/Python.framework/Versions/Current/bin Using easy_install PyO...


python - How can I install pyCurl?

I used libcurl with no problems and used pyCurl once in the past. Now i want to set it up on my machine and dev. However i have no idea how to do it. I rather not DL libcirl files and compile that along with pycurl, i want to know the simplest method. I have libcurl installed on my machine. I am on Windows. I tried DLing the sources and use pycurl setup script, but I had no luck.


python - where does django install in ubuntu

I am looking for the init.py file for django. I tried whereis and find, but I get a lot of dirs.


python - Install mysqldb on snow leopard

I am trying to get started on working with Python on Django I am by profession a PHP developer and have been told to set up django and python on my current apache and mysql setup however I am having trouble getting the Mysqldb module for python to work, I must of followed about 6 different set of instructions, I am running snow leopard and have mysql installed natively it is not part of MAMP or similar. Please can some tel...


How to install 64-bit Python on Solaris?

I am trying to install Python 2.6 on Solaris by building the source on Solaris machine. I installed one this way and it appears that it is 32-bit. I downloaded some source tar ball as Linux or Unix for this purpose. Everything works well but I need 64-bit Python. I looked up the Python download site and there is no sepa...


macos - Install PyObjC on Python 2.6 on OS X 10.5?

OS X 10.5.8 came with Python 2.5, and had PyObjC already installed. I installed Python 2.6 from the python.org site, and PyObjC isn't there. I can't find a download to install PyObjC on my Python 2.6 install. Is checking out the PyObjC trunk and trying to build it my only choice? Will that work "out of the box"?


python - How to install numpy and scipy on Windows XP


python - How do I install SciPy on 64 bit Windows?

How do I install SciPy on my system? For the NumPy part (that SciPy depends on) there is actually an installer for 64 bit Windows: numpy-1.3.0.win-amd64-py2.6.msi (is direct download URL, 2310144 bytes). Running the SciPy superpack installer results in this message in a dialog box:...


What should I install in order to be able to use GTK in Python on Ubuntu?

In my source code I have: import gtk But when I run the script with python3 script.py command I get the following error. What package should I install to get it working? Edit: my bad. here is the error: ImportError: No module named gtk Edit2: Thanks for the answer, kaizer.se. But I'm still getting an error message. Take a look at the following...


python - How to install pycairo on osx?

I am trying to install the pycairo (Python bindings for the cairo graphics library) under OSX. I started with easy_install pycairo and got: Requested 'cairo >= 1.8.8' but version of cairo is 1.0.4 error: Setup script exited with Error: cairo...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top