At first there is this demand, is because the YAH3C replacement INode for Campus network certification, has been compiled error, the hint can not find a Python module, Baidu a bit, this module is in Python2.7 above only, But the system's own Python is version 2.6, no wonder it has not been connected to the Internet. So, continue to Baidu Google, to install, and then there are problems ... At the beginning of this record, the right to be a memo.
View the version of Python
[Plain]View Plaincopy
- #python-V
- Python 2.6.6
1. Download Python-2.7.3
[Plain]View Plaincopy
- #wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
2. Unzip
[Plain]View Plaincopy
- #tar-JXVF python-2.7.3.tar.bz2
3. Change the working directory
[Plain]View Plaincopy
- #cd Python-2.7.3
4. Installation
[Plain]View Plaincopy
- #./configure
- #make All
- #make Install
- #make Clean
- #make Distclean
5. View version Information
[Plain]View Plaincopy
- #/usr/local/bin/python2.7-v
6. Establish a soft connection so that the system default Python points to python2.7
[Plain]View Plaincopy
- #mv/usr/bin/python/usr/bin/python2.6.6
- #ln-S/usr/local/bin/python2.7/usr/bin/python
7. Re-examine the Python version
[Plain]View Plaincopy
- #python-V
8 Resolve system Python soft link to Python2.7 version, since Yum is not compatible with Python 2.7, Yum does not work properly and we need to specify the Python version of Yum
[Plain]View Plaincopy
- #vi/usr/bin/yum
The file header is
#!/usr/bin/python
Change into
#!/usr/bin/python2.6.6
http://www.zhangchun.org/the-centos6-3-upgrade-python-to-2-7-3-
This tutorial is here, but soon suddenly found that the IME icon is missing, and then typing no candidate box! IBus's Blown! Again to search, but also version of the problem IBUs is not support Python2.7 Ah!
So...
9. Configure IBUs
Use VI to open the following two files, find the Exec Python line, the exec python changed to exec python2.6 save, exit. The IBUs is back to normal after a reboot! Are you happy?
[Plain]View Plaincopy
- #vi/usr/bin/ibus-setup
[Plain]View Plaincopy
- #vi/USR/LIBEXEC/IBUS-UI-GTK
CentOS Python 2.7 Installation