Install python-2.7 and fabric on CentOS-5.6
Fri, 08/05/2011 - 11:57 — sandipInstall the required packages first:
# yum install gcc gcc-c++.x86_64 compat-gcc-34-c++.x86_64 openssl-devel.x86_64 zlib*.x86_64Download and install python-2.7 from source:
$ wget http://www.python.org/ftp/pyth on/2.7.2/Python-2.7.2.tgz
$ tar -xvzf Python-2.7.2.tgz
$ cd Python-2.7.2
$ ./configure --with-threads --enable-shared
$ make
# make installLink the shared library:
# echo "/usr/local/lib" >>/etc/ld.so.conf.d/loca l-lib.conf
# ldconfigVerify with:
$ which python
$ python -VInstall easy_install:
$ wget http://peak.telecommunity.com/ dist/ez_setup.py
# python ez_setup.pyInstall fabric via easy_install:
easy_install fabricTo get the location of site-packages for current version of python:
$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"Switching between python versions
Fri, 06/20/2008 - 01:18 — sandipIf you've installed a different version of python via yum using pyvault repos, then you need to switch the default python back to the systems default to avoid problems with the OS packages.
Install the alternatives first:
# alternatives --install /usr/bin/python python /usr/bin/python2.3 100
# alternatives --install /usr/bin/python python /usr/bin/python2.4 24where 100 and 24 are the priority numbers (Higher number prevailing).
Remove existing symlinks:
# rm /usr/bin/pythonConfigure the default:
# alternatives --config pythonOr, set it to create automatically, which will use the highest priority:
# alternatives --auto pythonCheck with:
$ python -V- sandip's blog
- Login or register to post comments