
{"id":44474,"date":"2023-10-03T13:24:50","date_gmt":"2023-10-03T13:24:50","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=44474"},"modified":"2023-10-03T13:24:50","modified_gmt":"2023-10-03T13:24:50","slug":"python-3-12-0-released-how-to-install-via-ubuntu-ppa","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2023\/10\/python-3-12-0-released-how-to-install-via-ubuntu-ppa\/","title":{"rendered":"Python 3.12.0 Released! How to Install via Ubuntu PPA"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/python-feature-icon.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-34796\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/python-feature-icon-250x250.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/python-feature-icon-250x250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/python-feature-icon-300x300.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/python-feature-icon-600x600.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/python-feature-icon-768x768.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/python-feature-icon.png 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Python 3.12.0 final was officially announced this Monday! Ubuntu LTS can easily install it from PPA.<\/p>\n<p>New features in <a href=\"https:\/\/docs.python.org\/dev\/whatsnew\/3.12.html\" target=\"_blank\" rel=\"noopener\">Python 3.12.0<\/a>:<\/p>\n<ul>\n<li><a href=\"https:\/\/peps.python.org\/pep-0701\/\" target=\"_blank\" rel=\"noopener\">More flexible f-string parsing<\/a>, allowing many things previously disallowed.<\/li>\n<li>Python-level API for the buffer protocol<\/li>\n<li>New API for monitoring Python programs running on CPython at low cost.<\/li>\n<li>Per-Interpreter Global Interpreter Locks<\/li>\n<li>Support for the Linux perf profiler to report Python function names in traces.<\/li>\n<li>New type annotation syntax for generic classes<\/li>\n<li>New decorator <code>typing.override()<\/code> in the typing module.<\/li>\n<\/ul>\n<p>The new Python release also removed a few deprecated modules, including <code>smtpd<\/code> and <code>distutils<\/code>. For <b>Ubuntu 22.04<\/b>, <b>Ubuntu 20.04<\/b>, it causes a broken pip. As a workaround, you need to <a href=\"https:\/\/pip.pypa.io\/en\/stable\/installation\/#get-pip-py\" target=\"_blank\" rel=\"noopener\">manually install pip<\/a> for Python 3.12.<\/p>\n<h3>How to Install Python 3.12.0 in Ubuntu:<\/h3>\n<p>For Ubuntu 22.04, Ubuntu 20.04, and their derivatives such as Linux Mint 21, the <a href=\"https:\/\/launchpad.net\/~deadsnakes\/+archive\/ubuntu\/ppa\/\" target=\"_blank\" rel=\"noopener\">Deadsnakes PPA<\/a> has made the packages for all supported CPU architecture types: amd64, arm64\/armhf, ppc64el, and s390x.<\/p>\n<p><b>1.<\/b> First, press <b>Ctrl+Alt+T<\/b> on keyboard to open terminal. Then paste the command below and hit run to add PPA:<\/p>\n<pre>sudo add-apt-repository ppa:deadsnakes\/ppa<\/pre>\n<p><i>Type user password (no asterisk feedback) when it asks and hit Enter to continue.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/10\/deadsnake-ppa-jammy.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43245\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/10\/deadsnake-ppa-jammy-600x262.webp\" alt=\"\" width=\"600\" height=\"262\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/10\/deadsnake-ppa-jammy-600x262.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/10\/deadsnake-ppa-jammy-300x131.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/10\/deadsnake-ppa-jammy-768x335.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/10\/deadsnake-ppa-jammy.webp 780w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>2.<\/b> Ubuntu 20.04+ automatically refresh package cache while adding PPA. However, Linux Mint user may need to do this job manually by running command:<\/p>\n<pre>sudo apt update<\/pre>\n<p><b>3.<\/b> Finally, run command to install Python 3.12:<\/p>\n<pre>sudo apt install python3.12<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44030\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12-600x379.webp\" alt=\"\" width=\"600\" height=\"379\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12-600x379.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12-300x190.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12-768x486.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12-1536x971.webp 1536w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12-1320x835.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/05\/apt-python3.12.webp 1572w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>For other Ubuntu editions, you may manually <a href=\"https:\/\/ubuntuhandbook.org\/index.php\/2021\/10\/compile-install-python-3-10-ubuntu\/\" rel=\"noopener\" target=\"_blank\">compile Python 3.12<\/a> from source tarball.<\/p>","protected":false},"excerpt":{"rendered":"<p>Python 3.12.0 final was officially announced this Monday! Ubuntu LTS can easily install it from PPA. New features in Python 3.12.0: More flexible f-string parsing, allowing many things previously disallowed. Python-level API for the buffer protocol New API for monitoring Python programs running on CPython at low cost. Per-Interpreter Global Interpreter Locks Support for the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":34796,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[2045],"class_list":["post-44474","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-python"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/44474","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=44474"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/44474\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/34796"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=44474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=44474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=44474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}