Install python2.7.3
The code is as follows |
Copy Code |
Wget-c http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz Tar zxvf python-2.7.3.tgz CD Python-2.7.3 ./configure Make && make install Mv/usr/bin/python/usr/bin/python_bak Ln-s/usr/local/bin/python/usr/bin/python echo "/usr/local/lib" >>/etc/ld.so.conf |
Install Python3
Download:
The code is as follows |
Copy Code |
Wget-c http://www.python.org/ftp/python/3.1.3/Python-3.1.3.tar.bz2 Decompression Compile Installation: $ TAR–JXVF python-2.5.2.tar.bz2 $ CD Python-2.5.2 $./configure $ make $ make Install |
Since the default installation of CentOS is 2.4, direct input to Python is 2.4
The code is as follows |
Copy Code |
# python Python 2.4.3 (#1, Dec 11 2006, 11:38:52) [GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2 Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information. >>> |
The following modifications can be resolved
code is as follows |
copy code |
cd / Usr/bin ll |grep python ln-s/root/python-3.1.3/python ./python ///root/python-3.1.3/ Python for the Extract directory now input python display as 3.1 of the [root@chxy bin]# python python 3.1.3 (r313:86834, jan 2 2011, 02:12:38) br> [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2 Type ' help ', ' copyright ', ' credits ' or ' license ' for more inform ation. >>> |