How to upgrade Python

Source: Internet
Author: User

#以下方法是在centos6.5 test, the specific needs of the user testing.

1. Download python3.6.5
wget https://www.Python.org/ftp/python/3.6.5/Python-3.6.5.tgz
2. Unzip Python
TAR-ZVXF python-3.6.5.tgz
MV Python-3.6.5 ~/softwares/python-3.6.3
#softwares文件夹没有可以建立
3. Enter the Python folder to create the installation directory
CD ~/softwares/python-3.6.5
mkdir/usr/local/python3.6.5
4. Configure the Python installation location
./configure--prefix=/usr/local/python3.6.5
5. Compiling python
Make
6. Install Python
Make install
"Zipimport" appears during compilation. Zipimporterror:can ' t decompress data; Zlib Not Available "error message is caused by a missing package, the workaround is to install the required package:
Yum Install zlib zlib-devel-y
7. Back up the original Python command execution file
Mv/usr/bin/python/usr/bin/pythonbak
8. Create a new Python soft connection
Ln-s/usr/local/python3.6.5/bin/python3.6/usr/bin/python
9. View the Python version
Python

Python upgrade method

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.