{"id":48978,"date":"2025-05-28T15:36:16","date_gmt":"2025-05-28T15:36:16","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=48978"},"modified":"2025-10-08T14:54:55","modified_gmt":"2025-10-08T14:54:55","slug":"install-python-3-14-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2025\/05\/install-python-3-14-ubuntu\/","title":{"rendered":"How to Install Python 3.14 Stable in Ubuntu"},"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.14, the latest version of this popular programming language released. Here&#8217;s how to install it in all current Ubuntu releases.<\/p>\n<p>Python 3.14 was released on October 07, 2025, with 5 years of support until 2030. <del datetime=\"2025-10-08T14:41:19+00:00\">It&#8217;s so far in Beta for testing and software developers to prepare their project for new Python version compatibility.<\/del><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/py314-stable.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-49793\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/py314-stable-700x508.webp\" alt=\"\" width=\"610\" height=\"443\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/py314-stable-700x508.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/py314-stable-300x218.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/py314-stable-768x557.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/py314-stable.webp 891w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<p>The new Python 3.14 features deferred evaluation of annotations, t-strings, new module compression.zstd, new type of interpreter, syntax highlighting in PyREPL, and various othern new features, See <a href=\"https:\/\/docs.python.org\/3.14\/whatsnew\/3.14.html\" target=\"_blank\" rel=\"noopener\">this page<\/a> for details.<\/p>\n<h3>Install Python 3.14 in Ubuntu<\/h3>\n<p>For all current Ubuntu releases, including 20.04, 22.04, 24.04, 25.10, 25.04, and their flavors, Python 3.14 is easy to install by either compiling from source or using an Ubuntu PPA.<\/p>\n<h4>Option 1: Install Python 3.14 from PPA<\/h4>\n<p>The popular <a href=\"https:\/\/launchpad.net\/~deadsnakes\/+archive\/ubuntu\/ppa\" target=\"_blank\" rel=\"noopener\">Deadsnakes PPA<\/a> has built the new release for <b>Ubuntu 22.04<\/b> and <b>Ubuntu 24.04<\/b> on all supported CPU platforms (<code>amd64<\/code>, <code>arm64<\/code>\/<code>armhf<\/code>, <code>ppc64el<\/code>, <code>s390x<\/code>).<\/p>\n<p>Simply press <code>Ctrl+Alt+T<\/code> on keyboard to open up a terminal window, then you may run the commands below one by one to install the package.<\/p>\n<ul>\n<li>First, run command to add the PPA:\n<pre>sudo add-apt-repository ppa:deadsnakes\/ppa<\/pre>\n<p><i>Type your password (no asterisk feedback) when it asks and hit Enter to continue.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/deadsnakes-noble-ppa.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48980\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/deadsnakes-noble-ppa-700x459.webp\" alt=\"\" width=\"610\" height=\"400\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/deadsnakes-noble-ppa-700x459.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/deadsnakes-noble-ppa-300x197.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/deadsnakes-noble-ppa.webp 730w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/li>\n<li>Next, run command to install Python 3.14:\n<pre>sudo apt install python3.14<\/pre>\n<p>For choice, replace <code>python3.14<\/code> with <code>python3.14-full<\/code> in command to also install the Tkinter IDE, samples, pyvenv binary, etc.<\/p>\n<p>NOTE: Linux Mint users need to run <code>sudo apt update<\/code> after added PPA to manually refresh system package cache.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/apt-python314.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48981\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/apt-python314-700x459.webp\" alt=\"\" width=\"610\" height=\"400\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/apt-python314-700x459.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/apt-python314-300x197.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/apt-python314.webp 730w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/li>\n<\/ul>\n<p>After installed the package, run <code>python3.14 --version<\/code> command to verify the version, and <code>whereis python3.14<\/code> to see where it&#8217;s installed (usually under <code>\/usr\/bin<\/code>).<\/p>\n<h4>Option 2: Compile Python 3.14 from source code<\/h4>\n<p>If you&#8217;re not Ubuntu 22.04|24.04 user, or you don&#8217;t trust third-party package, then you may compile Python 3.14 by yourself. And, I&#8217;ve successfully built it in Ubuntu 20.04 and Ubuntu 25.04.<\/p>\n<p>1. First, go to Python website via the link below to download the source tarball:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/www.python.org\/ftp\/python\/\" target=\"_blank\" rel=\"noopener\">Download Python Source Tarball<\/a><\/div>\n<\/div>\n<p>So far, the latest is &#8220;Python-3.14.0.tar.xz&#8221;.<\/p>\n<p>2. After that, open <i>Downloads<\/i> folder, and decompress the tarball. Then, right-click on the extracted source folder and select &#8220;<b>Open in Terminal<\/b>&#8221; to open the Python 3.14 source folder as working directory in terminal.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/open-py314-terminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-49794\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/open-py314-terminal-700x481.webp\" alt=\"\" width=\"610\" height=\"419\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/open-py314-terminal-700x481.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/open-py314-terminal-300x206.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/open-py314-terminal-768x528.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/open-py314-terminal.webp 891w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>3. Finally, run the commands below one by one in that terminal window to build &amp; install it:<\/p>\n<ul>\n<li>First, run command to install the dependency libraries:\n<pre>sudo apt install wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev<\/pre>\n<\/li>\n<li>Next, configure the source by running command:\n<pre>.\/configure --enable-optimizations<\/pre>\n<p>If the default configure options do not meet your need, run <code>.\/configure --help<\/code> to list all available options, and replace the last command accordingly.<\/li>\n<li>Then, run command to compile the source:\n<pre>make -j4<\/pre>\n<p>Here <code>-j4<\/code> means start 4 threads in parallel. Depends on how many CPU cores you have, replace number 4 accordingly.<\/li>\n<li>Finally, run the command below to install:\n<pre>sudo make install<\/pre>\n<\/li>\n<\/ul>\n<p>By default, it builds &amp; installs Python into <code>\/usr\/local<\/code> directory. You may run <code>whereis python3.14<\/code> to tell.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/compile-python314.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48983\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/compile-python314-700x427.webp\" alt=\"\" width=\"610\" height=\"372\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/compile-python314-700x427.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/compile-python314-300x183.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/compile-python314-768x468.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/compile-python314.webp 1110w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Set or Unset Python 3.14 as Default<\/h3>\n<p><b>It&#8217;s NOT recommended to set non-pre-installed Python as default in Ubuntu, as it may break things!<\/b><\/p>\n<p>If you compiled and installed Python 3.14 from the source tarball, then it should be already &#8216;set&#8217; as default. Because it creates <code>\/usr\/local\/bin\/python3<\/code> (link to python 3.14) which is prior to the <code>\/usr\/bin\/python3<\/code>.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314b3-version.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-49127\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314b3-version-700x375.webp\" alt=\"\" width=\"610\" height=\"327\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314b3-version-700x375.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314b3-version-300x161.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314b3-version.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>In the case, you may restore the pre-installed Python as default, by simply deleting the <code>\/usr\/local\/bin\/python3<\/code> file.<\/p>\n<pre>sudo rm \/usr\/local\/bin\/python3<\/pre>\n<p>Similarly, also delete the <code>pip3<\/code>, <code>pydoc3<\/code>, <code>idle3<\/code>, <code>python3-config<\/code>, etc links under <code>\/usr\/local\/bin<\/code>.<\/p>\n<p>If you installed Python 3.14 from PPA, then run commands below one by one to set it as default:<\/p>\n<ul>\n<li>First, run command to tell the pre-installed Python version:\n<pre>ls -al \/usr\/bin\/python3<\/pre>\n<p>It&#8217;s Python 3.8 for 20.04, Python 3.10 for 22.04, Python 3.12 for 24.04 &amp; 24.10, and Python 3.13 for 25.04.<\/li>\n<li>Then, run the command below to install python 3.14 as alternative:\n<pre>sudo update-alternatives --install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.14 10<\/pre>\n<\/li>\n<li>Also, install the pre-installed python (replace <code>python3.12<\/code> accordingly) as an alternative:\n<pre>sudo update-alternatives --install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.12 100<\/pre>\n<\/li>\n<li>Finally, run the command below at anytime to choose one as default:\n<pre>sudo update-alternatives --config python3<\/pre>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-alternative.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48985\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-alternative-700x274.webp\" alt=\"\" width=\"610\" height=\"239\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-alternative-700x274.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-alternative-300x118.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-alternative-768x301.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-alternative.webp 970w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Optionally, you may run commands above by replace <code>python3<\/code> with <code>pip3<\/code> to set default pip installer.<\/p>\n<h3>Set virtual environment for python 3.14<\/h3>\n<p>Due to <a href=\"https:\/\/peps.python.org\/pep-0668\/\" target=\"_blank\" rel=\"noopener\">PEP 668<\/a>, it&#8217;s recommended to set a virtual environment for installing Python modules and packages without messing up the system packages.<\/p>\n<p>First, if you installed Python 3.14 from PPA, then make sure you also have the <code>pyvenv<\/code> binary installed:<\/p>\n<pre>sudo apt install python3.14-venv<\/pre>\n<p>Then, run the command to create a virtual environment:<\/p>\n<pre>python3.14 -m venv ~\/.venv\/python3.14<\/pre>\n<p><i>Here you may replace <code>~\/.venv\/python3.14<\/code> to whatever folder in your user home. After that, it creates a copy of Python 3.14 into that folder<\/i><\/p>\n<p>Next, run command to get into that virtual environment:<\/p>\n<pre>source ~\/.venv\/python3.14\/bin\/activate<\/pre>\n<p>Finally, run <code>pip<\/code> command to install any packages or modules, e.g., pip3 install 123. And, set <code>~\/.venv\/python3.14\/bin\/python3<\/code> as the path to the executable for your IDE.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-venv.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48986\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-venv-700x480.webp\" alt=\"\" width=\"610\" height=\"418\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-venv-700x480.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-venv-300x206.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/05\/python314-venv.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Uninstall Python 3.14<\/h3>\n<p>For the PPA package, simply open terminal and run command to remove:<\/p>\n<pre>sudo apt remove --autoremove python3.14 python3.14-full<\/pre>\n<p>For Python 3.14 built from source, just manually delete all the installed files, by running the commands below one by one:<\/p>\n<pre>sudo rm -R \/usr\/local\/lib\/python3.14\/<\/pre>\n<pre>sudo rm -R \/usr\/local\/include\/python3.14<\/pre>\n<pre>sudo rm \/usr\/local\/lib\/libpython3.14.a<\/pre>\n<pre>sudo rm \/var\/lib\/dpkg\/info\/*python3.14*<\/pre>\n<pre>sudo rm \/usr\/local\/bin\/python3 \/usr\/local\/bin\/python3.14<\/pre>\n<pre>sudo rm \/usr\/local\/bin\/pip3 \/usr\/local\/bin\/pip3.14<\/pre>\n<pre>sudo rm \/usr\/local\/bin\/idle3 \/usr\/local\/bin\/idle3.14<\/pre>\n<pre>sudo rm \/usr\/local\/bin\/pydoc3 \/usr\/local\/bin\/pydoc3.14<\/pre>\n<pre>sudo rm \/usr\/local\/bin\/python3-config \/usr\/local\/bin\/python3.14-config<\/pre>\n<p>Finally, delete the <b>.venv<\/b> (hidden by default, press Ctrl+H to view) in your user home folder to remove the virtual environment.<\/p>","protected":false},"excerpt":{"rendered":"<p>Python 3.14, the latest version of this popular programming language released. Here&#8217;s how to install it in all current Ubuntu releases. Python 3.14 was released on October 07, 2025, with 5 years of support until 2030. It&#8217;s so far in Beta for testing and software developers to prepare their project for new Python version compatibility.<\/p>\n","protected":false},"author":1,"featured_media":34796,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[2086,2045],"class_list":["post-48978","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-programming","tag-python"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/48978","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=48978"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/48978\/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=48978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=48978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=48978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}