{"id":786,"date":"2021-04-13T06:07:41","date_gmt":"2021-04-13T06:07:41","guid":{"rendered":"https:\/\/usemynotes.com\/?p=786"},"modified":"2023-02-27T17:05:45","modified_gmt":"2023-02-27T17:05:45","slug":"how-to-set-up-python-environment","status":"publish","type":"post","link":"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/","title":{"rendered":"How to set up Python Environment?"},"content":{"rendered":"<p>Hey folks, welcome back, in this module, I am going to discuss How to set up Python Environment. Since, we have covered a lot of things related to Python like <a href=\"https:\/\/usemynotes.com\/what-are-the-features-of-python\/\">Features of Python<\/a>, <a href=\"https:\/\/usemynotes.com\/what-are-the-applications-of-python\/\">Applications of Python<\/a>, and many more.<br \/>\nSo, it&#8217;s my turn to start working with Python Environment Setup.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_set_up_Python_Environment\" >How to set up Python Environment?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_install_Python\" >How to install Python?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_install_Python_on_the_Windows_platform\" >How to install Python on the Windows platform?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_install_Python_on_Linux_and_Unix_platforms\" >How to install Python on Linux and Unix platforms?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_install_Python_on_the_MAC_OS_platform\" >How to install Python on the MAC OS platform?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_Set_up_Path_for_Python\" >How to Set up Path for Python?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_set_up_the_path_of_Windows_platforms\" >How to set up the path of Windows platforms?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_set_up_the_path_in_LinuxUnix_platforms\" >How to set up the path in Linux\/Unix platforms?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/#How_to_set_up_the_path_in_the_Mac_OS_platform\" >How to set up the path in the Mac OS platform?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_to_set_up_Python_Environment\"><\/span>How to set up Python Environment?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Since we know that one can work with python on any platform whether it is Windows, Linux, or Mac. And the main thing is where you will write your code in Python language. You can write it in a WordPad or a Notepad. Before executing any Python code, we need a Python setup\/installer installed in our system using which our system will be able to execute Python code.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-791 size-full\" src=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-set-up-python-environment.png\" alt=\"How to set up Python Environment\" width=\"1000\" height=\"600\" title=\"\" srcset=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-set-up-python-environment.png 1000w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-set-up-python-environment-300x180.png 300w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-set-up-python-environment-768x461.png 768w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-set-up-python-environment-150x90.png 150w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-set-up-python-environment-696x418.png 696w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-set-up-python-environment-700x420.png 700w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_install_Python\"><\/span>How to install Python?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Let\u2019s see how we can install python on different platforms. We will cover them all one by one.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-792 size-full\" src=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-install-python.jpg\" alt=\"How to install Python\" width=\"1000\" height=\"561\" title=\"\" srcset=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-install-python.jpg 1000w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-install-python-300x168.jpg 300w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-install-python-768x431.jpg 768w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-install-python-150x84.jpg 150w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-install-python-696x390.jpg 696w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-install-python-749x420.jpg 749w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_install_Python_on_the_Windows_platform\"><\/span>How to install Python on the Windows platform?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For installing Python on the Windows platform, follow the steps that are given below.<\/p>\n<ul>\n<li>Open your web browser and open the official python page from where you can download the python installer i.e., <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.python.org\/downloads\/<\/a><\/li>\n<li>Click on the Windows hyperlink.<\/li>\n<li>Click on the link for the Windows Installer named in the format \u201cpython-PQR.msi\u201d where PQR is the version that you want to install. The latest version for Windows is Python 3.9.4.<\/li>\n<li>Your Windows system must support the Microsoft installer 2.0, only then you will be able to run the installer.<\/li>\n<li>Once downloaded, save the installer file to your local machine and then run it to find out whether your machine supports MSI or not.<\/li>\n<li>If everything is on track, the Python Installation Wizard will appear on the screen.<\/li>\n<li>Accept all the settings with their defaults and wait till the installation gets completed.<\/li>\n<li>Once the installation is complete, it&#8217;s done and Python is installed in your system successfully.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"How_to_install_Python_on_Linux_and_Unix_platforms\"><\/span>How to install Python on Linux and Unix platforms?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let\u2019s see the steps to install Python on the Linux\/Unix platform.<\/p>\n<ul>\n<li>Open your web browser and open the official python page from where you can download the Python installer\/package i.e., https:\/\/www.python.org\/downloads\/<\/li>\n<li>Click on the Linux\/Unix hyperlink.<\/li>\n<li>You can find the link to download the zipped source code for Linux\/Unix.<\/li>\n<li>Download the file and extract the same in your system.<\/li>\n<li>If you want some options to be customized, then you can edit the module\/setup files.<br \/>\nrun.\/configure script.<\/li>\n<li>Make install<\/li>\n<li>Python will get installed at the standard location i.e., \/usr\/local\/bin and its libraries will be stored at \/usr\/local\/lib\/pythonXX where XX depicts the version of Python.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"How_to_install_Python_on_the_MAC_OS_platform\"><\/span>How to install Python on the MAC OS platform?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Visit the Python website i.e., https:\/\/www.python.org\/downloads\/mac-osx\/<\/p>\n<ul>\n<li>All the instructions are present there for you to get the current version of Python with extra tools which will enable our system to support the development in MAC.<\/li>\n<li>If your MAC OS is older, i.e., if it was released in 2003 or the version is MAC OS X 10.3, that a separate package named MacPython is available.<\/li>\n<li>Recent versions of MAC are shipped with Python pre-installed in it.<\/li>\n<\/ul>\n<p>Upon the completion of the installation process, the next step is to set the path. Let\u2019s see why it is necessary and how to do it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Set_up_Path_for_Python\"><\/span>How to Set up Path for Python?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Many programs and other executable files are stored in different directories in our system. An operating system provides a search path that lists the directories to be searched by OS for executables.<\/p>\n<p>The path variable is named Path in windows and PATH in Linux\/Unix. One thing to be noted here is that Linux is case-sensitive whereas Windows is not.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_set_up_the_path_of_Windows_platforms\"><\/span>How to set up the path of Windows platforms?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To set the directory of python to the particular path in the windows platform, follow the given steps.<\/p>\n<ul>\n<li>Open the command prompt and type path %path%;C:\\Python and then press Enter. Here, the path of the python directory is C:\\Python<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"How_to_set_up_the_path_in_LinuxUnix_platforms\"><\/span>How to set up the path in Linux\/Unix platforms?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To set the python directory to the Unix platform&#8217;s path, follow the given steps.<\/p>\n<ul>\n<li>Open the csh shell and type setenv PATH &#8220;$PATH:\/usr\/local\/bin\/python&#8221; and press then Enter.<\/li>\n<li>Open the Bash Shell (Linux) and type export PATH=&#8221;$PATH:\/usr\/local\/bin\/python&#8221; and press hit Enter.<\/li>\n<li>In the sh or ksh shell, type PATH=&#8221;$PATH:\/usr\/local\/bin\/python&#8221; and then press Enter.<\/li>\n<li>Here, the path of the python directory is \/usr\/local\/bin\/python.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"How_to_set_up_the_path_in_the_Mac_OS_platform\"><\/span>How to set up the path in the Mac OS platform?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In Mac OS, the path details are handled by the installer itself. Now, if you want to invoke the Python interpreter from any directory, you have to add the Python directory to your environmental path of the system.<\/p>\n<p>Later, you can start Python by adding commands in the command line interpreter or in the shell window. Enter the \u2018python\u2019 command in the command line and start coding.<br \/>\nPython can be accessed through a graphical user interface (GUI) as well. For this, you must have a GUI-based application in your system that supports Python.<\/p>\n<p>Windows: You should have an IDE i.e., Integrated Development Environment. For example, PythonWin, which is the oldest IDE available for windows.<\/p>\n<p>Linux\/Unix: You should have IDLE, it is the very first IDE for the Unix platform.<br \/>\nI hope you all liked <strong>How to set up Python Environment?<\/strong> module and must be very excited to start your journey towards learning the <a href=\"https:\/\/usemynotes.com\/python\/\">python programming<\/a> language in detail. So, stay connected until the next module. Stay safe, keep learning, and Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey folks, welcome back, in this module, I am going to discuss How to set up Python Environment. Since, we have covered a lot of things related to Python like Features of Python, Applications of Python, and many more. So, it&#8217;s my turn to start working with Python Environment Setup. How to set up Python [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":791,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":{"0":"post-786","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"_links":{"self":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/posts\/786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/comments?post=786"}],"version-history":[{"count":0,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/posts\/786\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/media\/791"}],"wp:attachment":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/media?parent=786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/categories?post=786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/tags?post=786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}