centos6.x Upgrading Python

Source: Internet
Author: User

centos6.x Upgrading Python

centos6.x upgrade default Python2.6.6 to python2.7

Enter Python directly under CentOS to enter Python and see the current version information

[[email protected] ~]# python
Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

See here centos6.8 default Python or 2.6.6, now most of the development is generally using the 2.7.x or 3.x version below my virtual machine in the centos6.8 Python upgrade process simple summary
First of all, the python2.7 installation package download or through WINSCP and other ways to upload to the host, here is usedwgetWay, download python2.7 's Package command directly from official website as followswget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz, after the download is completetar -xvf Python-2.7.13.tgz For decompression,cd Python-2.7.13Go to directory, enter command./configureUpon completionecho $?Look at the state, if it is0Description no errors,make && make installFor installation.
configure: error: no acceptable C compiler found in $PATH
See `config.log‘ for more details

If the above error occurs because there is no GCC kit on the host, install the GCC Suite Yum mode installation. Because there is no path specified at compile time, the default is/usr/local/python2.7./usr/local/bin/python2.7 -vIn Python you can see that it is already python2.7.x, and then you need to back up the system's default version of Python and then modify Yum, otherwise Yum will prompt an error.
mv /usr/bin/python /usr/bin/python2.6.6For backup
ln -s /usr/local/bin/python2.7 /usr/bin/python
Then edit yum, Vi/usr/bin/python, and add 2.6.6 after the first line to #!/usr/bin/python2.6.6
The default for Python entry under CentOS is the 2.7.x version.

PIP is not installed here, if you want to install PIP, specify the parameters and install the dependent library in advance when the Python is compiled and installed.

... Not in the whole
In the compilation and installation of certain software, as far as possible in advance to the required library installation completed, if not sure which fear there is less, you can Google, to rely on the environment to install good, of course, where the error can be changed where ...


centos6.x Upgrading Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.