{"id":60,"date":"2020-09-02T11:21:17","date_gmt":"2020-09-02T11:21:17","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=60"},"modified":"2025-03-31T04:43:45","modified_gmt":"2025-03-31T04:43:45","slug":"install-python","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/getting-started\/install-python\/","title":{"rendered":"Install Python"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to install Python on your computer, including Windows, macOS, and Linux.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='install-python-on-windows'>Install Python on Windows <a href=\"#install-python-on-windows\" class=\"anchor\" id=\"install-python-on-windows\" title=\"Anchor for Install Python on Windows\">#<\/a><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id='download-python-installer'>Download Python Installer <a href=\"#download-python-installer\" class=\"anchor\" id=\"download-python-installer\" title=\"Anchor for Download Python Installer\">#<\/a><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noreferrer noopener\">download the latest version of Python<\/a> from the download page.<\/li>\n\n\n\n<li>Second, click the link for the latest stable version. Choose the Windows Installer (64-bit) option<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id='run-the-installer'><span style=\"font-size: revert; color: initial;\">Run the installer<\/span> <a href=\"#run-the-installer\" class=\"anchor\" id=\"run-the-installer\" title=\"Anchor for &lt;span style=&quot;font-size: revert; color: initial;&quot;&gt;Run the installer&lt;\/span&gt;\">#<\/a><\/h3>\n\n\n\n<p>Double-click the installer file to run the installer.<\/p>\n\n\n\n<p>In the installer window:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check <strong>Add Python to PATH <\/strong>at the bottom of the window<strong>. <\/strong>This ensures you can run the <code>python<\/code> command line without specifying its full path.<\/li>\n\n\n\n<li>Click Install Now to begin the installation.<\/li>\n\n\n\n<li>Leave other options as the default.<\/li>\n<\/ul>\n\n\n\n<p>It&#8217;ll take a few minutes to complete the setup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='verify-the-installation'>Verify the installation <a href=\"#verify-the-installation\" class=\"anchor\" id=\"verify-the-installation\" title=\"Anchor for Verify the installation\">#<\/a><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the Command Prompt by pressing Win + R, type, and press Enter.<\/li>\n\n\n\n<li>Check the install Python version using the command: <code>python --version<\/code>. You should see output indicating the version you install, e.g., Python 3.13.2<\/li>\n<\/ul>\n\n\n\n<p>If you see the following output from the Command Prompt after typing the <code>python<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Shell Session\" data-shcb-language-slug=\"shell\"><span><code class=\"hljs language-shell\">'python' is not recognized as an internal or external command,\noperable program or batch file.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Shell Session<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">shell<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>It&#8217;s likely that you didn&#8217;t check the <strong>Add Python to PATH<\/strong> checkbox when you installed Python.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='install-python-on-macos'>Install Python on macOS <a href=\"#install-python-on-macos\" class=\"anchor\" id=\"install-python-on-macos\" title=\"Anchor for Install Python on macOS\">#<\/a><\/h2>\n\n\n\n<p>It&#8217;s recommended to install Python on macOS using an official installer. Here are the steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, <a href=\"https:\/\/www.python.org\/downloads\/macos\/\" target=\"_blank\" rel=\"noreferrer noopener\">download a Python release for macOS<\/a>.<\/li>\n\n\n\n<li>Second, run the installer by double-clicking the installer file.<\/li>\n\n\n\n<li>Third, follow the instructions on the screen and click the Next button until the installer completes.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='install-python-on-linux'>Install Python on Linux <a href=\"#install-python-on-linux\" class=\"anchor\" id=\"install-python-on-linux\" title=\"Anchor for Install Python on Linux\">#<\/a><\/h2>\n\n\n\n<p>Before installing Python 3 on your Linux distribution, you check whether Python 3 was already installed by running the following command from the terminal:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">python3 --version<\/code><\/span><\/pre>\n\n\n<p>If you see a response with the version of Python, then your computer already has Python 3 installed. Otherwise, you can install Python 3 using a package management system.<\/p>\n\n\n\n<p>For example, you can install Python 3.13 on Ubuntu using apt:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">sudo<\/span> <span class=\"hljs-selector-tag\">apt<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">python3<\/span><span class=\"hljs-selector-class\">.13<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To install the newer version, you replace 3.13 with that version.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"60\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/getting-started\/install-python\/\"\n\t\t\t\tdata-post-title=\"Install Python\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"60\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/getting-started\/install-python\/\"\n\t\t\t\tdata-post-title=\"Install Python\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to install Python on your computer including Windows, macOS, and Linux.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":39,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-60","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":1,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/60\/revisions"}],"predecessor-version":[{"id":7288,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/60\/revisions\/7288"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/39"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}