{"id":32809,"date":"2020-10-06T12:28:30","date_gmt":"2020-10-06T12:28:30","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=32809"},"modified":"2020-10-06T12:28:30","modified_gmt":"2020-10-06T12:28:30","slug":"python-3-9-0-released-install-ppa-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2020\/10\/python-3-9-0-released-install-ppa-ubuntu\/","title":{"rendered":"Python 3.9.0 Released, How to Install via PPA in Ubuntu"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/07\/python-icon245.png\" alt=\"\" width=\"245\" height=\"250\" class=\"aligncenter size-full wp-image-6928\" \/><\/p>\n<p>Python programming language 3.9.0 was released with new features and optimizations. Here&#8217;s how to install it in Ubuntu 16.04, Ubuntu 18.04, and Ubuntu 20.04 via PPA.<\/p>\n<p>Python 3.9.0 is the first version default to the 64-bit installer on Windows. Windows 7 is unsupported.<\/p>\n<p><a href=\"https:\/\/www.python.org\/downloads\/release\/python-390\/\" target=\"_blank\">Python 3.9.0<\/a> release highlights:<\/p>\n<ul>\n<li>Module State Access from C Extension Methods<\/li>\n<li>Union Operators in dict<\/li>\n<li>Type Hinting Generics In Standard Collections<\/li>\n<li>Flexible function and variable annotations<\/li>\n<li>Python adopts a stable annual release cadence<\/li>\n<li>Relaxing Grammar Restrictions On Decorators<\/li>\n<li>Support for the IANA Time Zone Database in the Standard Library<\/li>\n<li>String methods to remove prefixes and suffixes<\/li>\n<li>New PEG parser for CPython<\/li>\n<li>Garbage collection does not block on resurrected objects;<\/li>\n<li>os.pidfd_open added that allows process management without races and signals;<\/li>\n<li>Unicode support updated to version 13.0.0;<\/li>\n<li>when Python is initialized multiple times in the same process, it does not leak memory anymore;<\/li>\n<li>A number of Python built-ins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;<\/li>\n<li>A number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;<\/li>\n<li>A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.<\/li>\n<\/ul>\n<h4>How to Install Python 3.9.0 in Ubuntu:<\/h4>\n<p><b>1.)<\/b> Open terminal either by pressing Ctrl+Alt+T on keyboard, or by searching for &#8216;terminal&#8217; from system application launcher.<\/p>\n<p>When terminal opens, run command to add the <a href=\"https:\/\/launchpad.net\/~deadsnakes\/+archive\/ubuntu\/ppa\" target=\"_blank\">\u201cdeadsnakes\u201d team PPA<\/a>:<\/p>\n<pre style=\"border:none;\">sudo add-apt-repository ppa:deadsnakes\/ppa<\/pre>\n<p><i>Type user password (no asterisk feedback) when it prompts and hit Enter to continue.<\/i><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/07\/deadsnakes-bionic.jpg\" alt=\"\" width=\"500\" height=\"67\" class=\"aligncenter size-full wp-image-10488\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/07\/deadsnakes-bionic.jpg 500w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/07\/deadsnakes-bionic-450x60.jpg 450w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><b>2.)<\/b> Then run commands to refresh system package cache, and install Python 3.9:<\/p>\n<pre style=\"border:none;\">sudo apt update\r\n\r\nsudo apt install python3.9<\/pre>\n<p><b>3.)<\/b> Once successfully installed, check your system Python versions (python &#8211;version):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/python39-version.png\" alt=\"\" width=\"600\" height=\"214\" class=\"aligncenter size-full wp-image-32810\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/python39-version.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/python39-version-450x161.png 450w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><b>4.) (NOT Recommended)<\/b> To use Python 3.9 as the default <code>python3<\/code>, run commands:<\/p>\n<pre style=\"border:none;\">sudo update-alternatives --install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.8 1\r\n\r\nsudo update-alternatives --install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.9 2<\/pre>\n<p><i>For <b>Ubuntu 16.04<\/b> and <b>Ubuntu 18.04<\/b>, replace <code>python3.8<\/code> in the code with system&#8217;s default python3 version.<\/i>.<br \/>\nAnd you can then switch between the two Python3 versions via command:<\/p>\n<pre style=\"border:None;\">sudo update-alternatives --config python3<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/python39-default.png\" alt=\"\" width=\"600\" height=\"334\" class=\"aligncenter size-full wp-image-32811\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/python39-default.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/python39-default-450x251.png 450w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><b>NOTE:<\/b> Due to known bug, terminal won&#8217;t open if you changed <code>python3<\/code> symlink. An workaround is recreate a symlink via command (<i>Replace <b>python 3.8<\/b> with your system default python3 version<\/i>):<\/p>\n<pre style=\"border:none;\">sudo rm \/usr\/bin\/python3; sudo ln -s <b>python3.8<\/b> \/usr\/bin\/python3<\/pre>\n<h4>Uninstall:<\/h4>\n<p>To uninstall the Python3.9 packages, run command:<\/p>\n<pre style=\"border:none;\">sudo apt remove --autoremove python3.9 python3.9-minimal<\/pre>\n<p>To remove the Deadsnakes PPA, launch <b>Software &#038; Updates<\/b> and go to <i>Other Software<\/i> tab, then remove the repository line and close the window.<\/p>","protected":false},"excerpt":{"rendered":"<p>Python programming language 3.9.0 was released with new features and optimizations. Here&#8217;s how to install it in Ubuntu 16.04, Ubuntu 18.04, and Ubuntu 20.04 via PPA. Python 3.9.0 is the first version default to the 64-bit installer on Windows. Windows 7 is unsupported. Python 3.9.0 release highlights: Module State Access from C Extension Methods Union [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1988],"class_list":["post-32809","post","type-post","status-publish","format-standard","hentry","category-news","tag-python-3-9"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/32809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=32809"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/32809\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=32809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=32809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=32809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}