{"id":9190,"date":"2020-11-19T09:37:02","date_gmt":"2020-11-19T14:37:02","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=9190"},"modified":"2021-12-04T07:04:39","modified_gmt":"2021-12-04T07:04:39","slug":"find-python-installation-path-ubuntu-debian-mint","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/","title":{"rendered":"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint"},"content":{"rendered":"\n

There comes a time now and again when you might want to know where your Python installation path on your Ubuntu, Debian<\/a>, or Linux Mint distros is located.<\/p>\n\n\n\n

Generally, by default, your Python<\/a> binary is located at \/usr\/bin\/python<\/em> but it may not always be a guarantee depending on the version you are using. As you can see from this post<\/a> you can actually install a different version from the default that comes with your distro.<\/p>\n\n\n\n

As with the case with many things on Linux<\/a> systems, there is more than one way to reliably get the Python installation path on that system.<\/p>\n\n\n\n

Getting the Python Installation Path Using PYTHONPATH<\/h2>\n\n\n\n

You can get the value of PYTHONPATH only if it has been set. This is an environment variable that is available on the system. If it has not been set then the result of running any one of the commands below will not return anything.<\/p>\n\n\n\n

  1. Echo the path<\/em><\/li><\/ol>\n\n\n\n
    $ echo $PYTHONPATH<\/code><\/pre>\n\n\n\n

    2. Using grep<\/em><\/p>\n\n\n\n

    $ env | grep PYTHONPATH<\/code><\/pre>\n\n\n\n

    3. Using printenv<\/em><\/p>\n\n\n\n

    $ printenv PYTHONPATH<\/code><\/pre>\n\n\n\n

    If the above commands do not work you can also get the path using the which command as shown below.<\/p>\n\n\n\n

    $ which python\n\n\/usr\/bin\/python<\/code><\/pre>\n\n\n\n

    Conclusion<\/h2>\n\n\n\n

    Once you know the path of the default Python installation path for your system you can permanently add it as an environment variable by opening the startup file you use for your default shell. This is usually ~\/.profile<\/em> in Ubuntu<\/a>.<\/p>\n\n\n\n

    Open the file in your preferred editor and add the following line at the end of that file.<\/p>\n\n\n\n

    export PYTHONPATH=\/usr\/bin\/python<\/code><\/pre>\n\n\n\n

    You then need to restart your terminal to effect the change. You can also run the above on the command-line if you just need it to last the current session.<\/p>\n","protected":false},"excerpt":{"rendered":"

    There comes a time now and again when you might want to know where your Python installation path on your Ubuntu, Debian, or Linux Mint distros is located. Generally, by…<\/p>\n","protected":false},"author":1,"featured_media":9191,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,16],"tags":[164,193,424,475,531,543,544,598,635,636,638],"yoast_head":"\nHow to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint<\/title>\n<meta name=\"description\" content=\"This guide will show you who to find the Python installation path to the binary using 3 methods on Ubuntu, Debian, or Linux Mint distros\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint\" \/>\n<meta property=\"og:description\" content=\"This guide will show you who to find the Python installation path to the binary using 3 methods on Ubuntu, Debian, or Linux Mint distros\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-19T14:37:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-04T07:04:39+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint\",\"datePublished\":\"2020-11-19T14:37:02+00:00\",\"dateModified\":\"2021-12-04T07:04:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/\"},\"wordCount\":284,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg\",\"keywords\":[\"Cross Platform\",\"DevOps\",\"Open Source\",\"Python\",\"Server\",\"Software Design\",\"Software development\",\"Ubuntu\",\"Web\",\"Web Applications\",\"Web Development\"],\"articleSection\":[\"Articles\",\"Guides\",\"Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/\",\"url\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/\",\"name\":\"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg\",\"datePublished\":\"2020-11-19T14:37:02+00:00\",\"dateModified\":\"2021-12-04T07:04:39+00:00\",\"description\":\"This guide will show you who to find the Python installation path to the binary using 3 methods on Ubuntu, Debian, or Linux Mint distros\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Python Installation Path\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/x.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint","description":"This guide will show you who to find the Python installation path to the binary using 3 methods on Ubuntu, Debian, or Linux Mint distros","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/","og_locale":"en_US","og_type":"article","og_title":"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint","og_description":"This guide will show you who to find the Python installation path to the binary using 3 methods on Ubuntu, Debian, or Linux Mint distros","og_url":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2020-11-19T14:37:02+00:00","article_modified_time":"2021-12-04T07:04:39+00:00","og_image":[{"width":1200,"height":630,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint","datePublished":"2020-11-19T14:37:02+00:00","dateModified":"2021-12-04T07:04:39+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/"},"wordCount":284,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg","keywords":["Cross Platform","DevOps","Open Source","Python","Server","Software Design","Software development","Ubuntu","Web","Web Applications","Web Development"],"articleSection":["Articles","Guides","Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/","url":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/","name":"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg","datePublished":"2020-11-19T14:37:02+00:00","dateModified":"2021-12-04T07:04:39+00:00","description":"This guide will show you who to find the Python installation path to the binary using 3 methods on Ubuntu, Debian, or Linux Mint distros","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/11\/Python-Installation-Path.jpg","width":1200,"height":630,"caption":"Python Installation Path"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/find-python-installation-path-ubuntu-debian-mint\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Find the Python Installation Path on Ubuntu, Debian, or Linux Mint"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/x.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/9190"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=9190"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/9190\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/9191"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=9190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=9190"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=9190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}