{"id":499,"date":"2019-04-27T17:30:22","date_gmt":"2019-04-27T15:30:22","guid":{"rendered":"http:\/\/exchangetimes.net\/?p=499"},"modified":"2019-07-15T19:00:33","modified_gmt":"2019-07-15T17:00:33","slug":"how-to-make-another-version-of-python-the-default-version-in-linux","status":"publish","type":"post","link":"http:\/\/exchangetimes.net\/?p=499","title":{"rendered":"How to make another version of Python the default version in Linux"},"content":{"rendered":"\n<p>In this post I show you how to make Python 3.7 the default version of Python on Linux. (This should work on all distributions of Linux).<\/p>\n\n\n\n<p> My default version of Python was Python 2 and I needed to change it to version 3.7. 1.<\/p>\n\n\n\n<p>Steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open your .bashrc file in your home directory using a text editor or the shell.<\/li><li>Add alias python=&#8217;\/usr\/bin\/pythonx.x&#8217; to the file and save it. (x.x is your version that you want to be the default)<\/li><li>Logout of your session or reboot your computer, then log back in.<\/li><li>Open the terminal and then type in <strong><em>Python<\/em><\/strong>. It should now show you the version that you specified in the .bashrc file<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-embed-youtube aligncenter wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to make another version of Python the default in Linux\" width=\"960\" height=\"540\" src=\"https:\/\/www.youtube.com\/embed\/06gDz203jhw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In this post I show you how to make Python 3.7 the default version of Python on Linux. (This should work on all distributions of Linux). My default version of Python was Python 2 and I needed to change it to version 3.7. 1. Steps: Open your .bashrc file in your home directory using a text editor or the shell. Add alias python=&#8217;\/usr\/bin\/pythonx.x&#8217; to the file and save it. (x.x is your version that you want to be the default) Logout of your session or reboot your computer, then log back in. Open the terminal and then type in Python. It should now show you the version that you specified in the .bashrc file<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,490],"tags":[497,495,366,492,496],"class_list":["post-499","post","type-post","status-publish","format-standard","hentry","category-linux","category-python","tag-change-python-version-permanently","tag-how-to-make-another-version-of-python-the-default-version-in-linux","tag-linux","tag-python","tag-python-3"],"_links":{"self":[{"href":"http:\/\/exchangetimes.net\/index.php?rest_route=\/wp\/v2\/posts\/499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/exchangetimes.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/exchangetimes.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/exchangetimes.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/exchangetimes.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=499"}],"version-history":[{"count":2,"href":"http:\/\/exchangetimes.net\/index.php?rest_route=\/wp\/v2\/posts\/499\/revisions"}],"predecessor-version":[{"id":514,"href":"http:\/\/exchangetimes.net\/index.php?rest_route=\/wp\/v2\/posts\/499\/revisions\/514"}],"wp:attachment":[{"href":"http:\/\/exchangetimes.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/exchangetimes.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/exchangetimes.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}