{"id":20,"date":"2019-01-08T18:53:39","date_gmt":"2019-01-08T18:53:39","guid":{"rendered":"https:\/\/kindsonthegenius.com\/python\/?p=20"},"modified":"2026-07-04T01:18:51","modified_gmt":"2026-07-04T01:18:51","slug":"02-python-installation-and-setup","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/python\/02-python-installation-and-setup\/","title":{"rendered":"Python &#8211; Installation and Setup"},"content":{"rendered":"<!-- ktg-updated-banner -->\n<div class=\"ktg-updated-banner\" style=\"margin:0 0 1.25em;padding:0.75em 1em;background:#fefce8;border-left:4px solid #ca8a04;border-radius:4px;\">\n<p><strong>Updated July 4, 2026.<\/strong> Refreshed for Python 3.12+ and current SEO best practices.<\/p>\n<\/div>\n\n<!-- ktg-python-modern -->\n<div class=\"ktg-python-modern\" style=\"margin:1.5em 0;padding:1em;background:#eff6ff;border-left:4px solid #2563eb;border-radius:4px;\">\n<h4>Python 3.12+ Notes<\/h4>\n<p>Download the latest <strong>Python 3.12+<\/strong> installer for your OS. On Windows, check <strong>Add python.exe to PATH<\/strong> during setup. Verify with <code>python --version<\/code> in your terminal before moving to Lesson 3.<\/p>\n<\/div>\n\n\r\n<p class=\"wp-block-paragraph\">Here, we are going to cover how to set up Python Installation in Windows and Mac.<\/p>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><a href=\"#t1\">Introduction<\/a><\/li>\r\n<li><a href=\"#t2\">Setting the PATH Variable<\/a><\/li>\r\n<li><a href=\"#t3\">Some Environment Variables to Know<\/a><\/li>\r\n<li><a href=\"#t4\">Watch the Video<\/a><\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"t1\">1. Introduction<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">First, the easiest way to set up Python is to install one of the distributions of Python. Therefore, I would recommend Anaconda, which you can download and install free from <a href=\"https:\/\/www.anaconda.com\/download\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.anaconda.com\/download\/<\/a><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In the download page, you can choose between the three operating systems<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Windows<\/li>\r\n<li>Mac<\/li>\r\n<li>Linux<\/li>\r\n<\/ul>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<p class=\"wp-block-paragraph\">The installation is fairly straightforward. After installation, you need to set up the PATH variable.<\/p>\r\n\r\n\r\n<hr \/>\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"t2\">2. Setting PATH Variable<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Since Python is an interpreted language, it means that the operating system would require the Python executable files.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The path to Python executable is stored in the environment variable which can be set by the user. To add the path to Python executable to the environment variable in Window:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>open the properties of My Computer<\/li>\r\n<li>Click on Advanced System Settings<\/li>\r\n<li>Then Environment Variables<\/li>\r\n<li>Select PATH from the list<\/li>\r\n<li>Click on Edit<\/li>\r\n<li>Then add the path to the Python executable to the end of the existing text.<\/li>\r\n<\/ul>\r\n\r\n\r\n<hr \/>\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"t3\">3. Some Environment Variables to Know<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">These are some environment variables used by Python and you may encounter in Python Quiz<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>PYTHONSTARTUP<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The PYTHONSTARTUP variable contains the path of the initialization file that contains the Python source code. It is processed each time the Python interpreter is started. In the Unix system, it&#8217;s name is .pythonrc.py and it holds the command that load utilities or modify the PYTHONPATH variable<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>PYTHONPATH<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The variable plays a role similar to the PATH variable. It tells the Python interpreter the location of module files that are imported into the program. Additionally, contains the Python source library directory as well as the directories containing the Python source code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>PYTHONHOME<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">This specifies an alternative module search directory. It is normally embedded into the PYTHONSTARTUP or the PYTHONPATH directories. This in then, makes it possible to switch module libraries easily.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>PYTHONCASEOK<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Finally, this is a variable used in Windows to tell Python to find the first case-insensitive match in a module import statement. To activate this variable, it can be set to any value<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"t4\">4. Watch the Video<\/h4>\r\n\r\n\r\n\r\n<figure><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/sP6Kt0wj8Dw\" width=\"560\" height=\"315\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/figure>\r\n\n\n<!-- ktg-lesson-nav -->\n<nav class=\"ktg-lesson-nav\" aria-label=\"Lesson navigation\">\n<p><strong>Previous:<\/strong> <a href=\"https:\/\/kindsonthegenius.com\/python\/01-python-introduction\/\">Lesson 1: Python &#8211; Introduction<\/a><\/p>\n<p><strong>Next:<\/strong> <a href=\"https:\/\/kindsonthegenius.com\/python\/03-python-variable-and-data-types\/\">Lesson 3: Python &#8211; Basic Syntax<\/a><\/p>\n<\/nav>\n\n<!-- ktg-alkademy-cta -->\n<div class=\"ktg-alkademy-cta\" style=\"margin:2em 0;padding:1.25em;border-left:4px solid #2563eb;background:#f8fafc;\">\n<p><strong>Want live Python classes?<\/strong> Join <a href=\"https:\/\/www.alkademy.com\/courses\" target=\"_blank\" rel=\"noopener noreferrer\">Alkademy<\/a> for instructor-led Python and data science courses with hands-on projects.<\/p>\n<\/div>\n\n<!-- ktg-author-trust -->\n<div class=\"ktg-author-trust\" style=\"margin:2em 0;padding:1.25em;border-top:1px solid #e2e8f0;\">\n<p>Kindson Munonye is a software engineer and technical author specializing in Python, data science, and machine learning. He publishes free step-by-step Python tutorials and live classes on Alkademy.\n\n<a href=\"https:\/\/github.com\/KindsonTheGenius\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub<\/a> \u00b7 <a href=\"https:\/\/www.linkedin.com\/in\/kindson\" target=\"_blank\" rel=\"noopener noreferrer\">LinkedIn<\/a> \u00b7 <a href=\"https:\/\/www.kindsonthegenius.com\/about\/\">About<\/a> \u00b7 <a href=\"https:\/\/www.alkademy.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Alkademy<\/a><\/p>\n<\/div>\n\n<!-- ktg-faq-schema -->\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"How do I install Python on Windows?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Download the installer from python.org, check Add Python to PATH, and verify with python --version in Command Prompt or PowerShell.\"}}, {\"@type\": \"Question\", \"name\": \"Which Python version should I use?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Use the latest stable Python 3 release (3.11 or 3.12+). Python 2 is end-of-life and should not be used for new projects.\"}}, {\"@type\": \"Question\", \"name\": \"What IDE should I use for Python?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"VS Code, PyCharm, or Cursor work well. Beginners can also use IDLE, which ships with Python on most platforms.\"}}]}<\/script>","protected":false},"excerpt":{"rendered":"<p>Updated July 4, 2026. Refreshed for Python 3.12+ and current SEO best practices. Python 3.12+ Notes Download the latest Python 3.12+ installer for your OS. &hellip; <\/p>\n","protected":false},"author":395,"featured_media":285,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorials"],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/users\/395"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":16,"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":567,"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/20\/revisions\/567"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/media\/285"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/python\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}