Tutorial on installing Python 3.6.0 in Ubuntu 16.04 LTS source code, 16.043.6.0

Source: Internet
Author: User

Tutorial on installing Python 3.6.0 in Ubuntu 16.04 LTS source code, 16.043.6.0

Prerequisites

The official website provides installation packages for Mac and Windows and the source code required for Linux installation.

As follows:

Https://www.python.org/downloads/release/python-360/

Install

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xzxz -d Python-3.6.0.tar.xztar -xvf Python-3.6.0.tarcd Python-3.6.0./configuremakesudo make install

Test:

$ python3.6 --versionPython 3.6.0

Test several new syntax features:

1.

# Formatted string literals>>> name = 'Ray'     >>> f"Hello {name}." 'Hello Ray.'

Equivalent

>>> name = 'Ray' >>> "Hello {name}.".format(name=name)'Hello Ray.'

2.

# Underscores in Numeric Literals>>> a = 1_000_000_000_000_000>>> a1000000000000000>>> '{:_}'.format(1000000)'1_000_000''1_000_000'

3.

# Enum.auto>>> from enum import Enum, auto>>> class Color(Enum):... red = auto()... blue = auto()... green = auto()... >>> list(Color)[<Color.red: 1>, <Color.blue: 2>, <Color.green: 3>]

Tips

After the first compilation and installation, you may find that the direction keys are invalid after you input python3.6.

The reason is that the readline library is not installed.

Solution:

Install the readline Library

sudo apt-get install libreadline-dev

After installation, re-compile and install python.

cd Python-3.6.0./configuremakesudo make install

Summary

The above is all about this article. I hope this article will help you in your study or work. If you have any questions, please leave a message.

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.