Tuesday, January 31, 2012

How to run and upgrade to Python 2.7 on CentOS

# nohup python yApp.py &

yum -y groupinstall 'Development Tools'
yum -y install openssl-devel* ncurses-devel* zlib*.x86_64</pre>
yum -y install bzip2 bzip2-devel bzip2-libs

#Download the latest available at this time
curl -O http://python.org/ftp/python/2.7/Python-2.7.tgz
#Unzip/expand file
tar xfz Python-2.7.tgz
#Change Directory to the unzipped folder
cd Python-2.7
#read README file or you can follow the lines below
./configure
#you could also run configure with threads and shared enabled
#./configure --prefix=/opt/python2.7 --with-threads --enable-shared
#Compile
make
#Install
make install
#To verify if the install succeeded
python -V
#Use UPPERCASE 'V' - not lower-case.
#Output will be "Python 2.7"
#Sometimes you may need to exit out of your shell
#and them come back in to see the version changes.
#So best exit your current shell prompt and reopen
#a new before checking the version.



I would completely remove that and install 2.7 rpms instead.
rm -rf /usr/local/python27/

No comments:

Post a Comment