根据 Python 的官方文档,Python2.7 的支持将在不久的将来结束。
弃用:Python 2.7 的生命周期将于 2020 年 1 月 1 日结束。请升级您的 Python,因为在该日期之后将不再维护 Python 2.7。pip 的未来版本将不再支持 Python 2.7。有关 pip 中 Python 2 支持的更多详细信息,请访问https://pip.pypa.io/en/latest/development/release-process/#python-2-support
为什么 Ubuntu 在即将推出的版本中不使用 Python3 作为默认设置?
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco
Run Code Online (Sandbox Code Playgroud)
$ python
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Run Code Online (Sandbox Code Playgroud) 我从 Ubuntu 19.10 升级到 20.04。很多文章提到最新的LTS将不支持python2。但我仍然拥有它。这是为什么?
$ python
Python 2.7.18rc1 (default, Apr 7 2020, 12:05:55)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello world!"
hello world!
>>>
Run Code Online (Sandbox Code Playgroud)