{"id":2942,"date":"2014-09-16T15:51:39","date_gmt":"2014-09-16T13:51:39","guid":{"rendered":"http:\/\/supportex.net\/blog\/?p=2942"},"modified":"2019-05-10T15:05:20","modified_gmt":"2019-05-10T13:05:20","slug":"installing-python-2-7-centos-6-5","status":"publish","type":"post","link":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/","title":{"rendered":"Installing Python 2.7 on Centos 6.5"},"content":{"rendered":"<p>Centos &nbsp;6.5 is shipped with Python version 2.6. And for some projects and\/or applications you may need to use version 2.7. First thing which comes to mind is to compile it from sources.&nbsp;But obviously it&#8217;s not the best way. It would create more problem in future, besides it&#8217;s quite easy to get the whole system broken. So there should be a better way. &nbsp;And there is: <a href=\"https:\/\/github.com\/yyuu\/pyenv\">pyenv<\/a>. <strong>Pyenv<\/strong> is a set of tools for Python versions management. You might be familiar with rbenv, similar thing for Ruby versions management. &nbsp;Installation of <strong>pyenv<\/strong> is very trivial using <a href=\"https:\/\/github.com\/yyuu\/pyenv-installer\">pyenv installer<\/a>:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">curl -L https:\/\/raw.githubusercontent.com\/yyuu\/pyenv-installer\/master\/bin\/pyenv-installer | bash<\/code><\/p>\n<p>Once it&#8217;s done, you can install Python 2.7. &nbsp;Let&#8217;s find the latest version of branch 2.7:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[user@pybox ~]$ pyenv install -l | grep 2.7\n2.7\n2.7.1\n2.7.2\n2.7.3\n2.7.4\n2.7.5\n2.7.6\n2.7.7\n2.7.8\n2.7-dev\nironpython-2.7.4\njython-2.7-beta1\njython-2.7-beta2\njython-2.7-beta3\nstackless-2.7.2\nstackless-2.7.3\nstackless-2.7.4\nstackless-2.7.5\nstackless-2.7.6\nstackless-2.7-dev\n[user@pybox ~]$\n<\/pre>\n<p>Ok, so it&#8217;s 2.7.8. Before proceeding we also need the following development packages:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel mysql-devel<\/code><\/p>\n<p>Now we are to ready to install version 2.7.8:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">pyenv install 2.7.8<\/code><\/p>\n<p>When the compilation process is over, check:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[user@pybox ~]$ python -V\nPython 2.6.6\n[user@pybox ~]$<\/pre>\n<p>Still 2.6.6. This is because our <strong>pyenv&nbsp;<\/strong> knows nothing about about our just installed Python.&nbsp;Let&#8217;s mark that we need version 2.7.8:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[user@pybox ~]$ pyenv local 2.7.8\n[user@pybox ~]$ python -V\nPython 2.7.8\n[user@pybox ~]<\/pre>\n<p>Here is what was changed:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[user@pybox ~]$ cat .python-version\n2.7.8\n[user@pybox ~]$\n<\/pre>\n<p>Now it&#8217;s installed and ready to use.<\/p>\n\n\n<p><a href=\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/?preview_id=2942&amp;preview_nonce=a54d91af2c&amp;preview=true\">Preview(opens in a new tab)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Centos &nbsp;6.5 is shipped with Python version 2.6. And for some projects and\/or applications you may need to use version 2.7. First thing which comes to mind is to compile it from sources.&nbsp;But obviously it&#8217;s not the best way. It would create more problem in future, besides it&#8217;s quite easy to get the whole system&hellip; <\/p>\n<div class=\"readmore-wrapper\"><a href=\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\" class=\"more-link\">Read <\/a><\/div>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[153],"class_list":["post-2942","post","type-post","status-publish","format-standard","hentry","category-linux","tag-pyenv"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Installing Python 2.7 on Centos 6.5 &#8211; Supportex.NET blog<\/title>\n<meta name=\"description\" content=\"How to instal Python 2.7 on Centos 6.5\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing Python 2.7 on Centos 6.5 &#8211; Supportex.NET blog\" \/>\n<meta property=\"og:description\" content=\"How to instal Python 2.7 on Centos 6.5\" \/>\n<meta property=\"og:url\" content=\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\" \/>\n<meta property=\"og:site_name\" content=\"Supportex.NET blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-16T13:51:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-10T13:05:20+00:00\" \/>\n<meta name=\"author\" content=\"Oleksii Tykhonov\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oleksii Tykhonov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\"},\"author\":{\"name\":\"Oleksii Tykhonov\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"headline\":\"Installing Python 2.7 on Centos 6.5\",\"datePublished\":\"2014-09-16T13:51:39+00:00\",\"dateModified\":\"2019-05-10T13:05:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\"},\"wordCount\":194,\"commentCount\":0,\"keywords\":[\"pyenv\"],\"articleSection\":[\"linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\",\"url\":\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\",\"name\":\"Installing Python 2.7 on Centos 6.5 &#8211; Supportex.NET blog\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\"},\"datePublished\":\"2014-09-16T13:51:39+00:00\",\"dateModified\":\"2019-05-10T13:05:20+00:00\",\"author\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"description\":\"How to instal Python 2.7 on Centos 6.5\",\"breadcrumb\":{\"@id\":\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/supportex.net\/blog\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing Python 2.7 on Centos 6.5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\",\"url\":\"https:\/\/supportex.net\/blog\/en\/\",\"name\":\"Supportex.NET blog\",\"description\":\"Server and network management company\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\",\"name\":\"Oleksii Tykhonov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"caption\":\"Oleksii Tykhonov\"},\"url\":\"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installing Python 2.7 on Centos 6.5 &#8211; Supportex.NET blog","description":"How to instal Python 2.7 on Centos 6.5","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":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/","og_locale":"en_US","og_type":"article","og_title":"Installing Python 2.7 on Centos 6.5 &#8211; Supportex.NET blog","og_description":"How to instal Python 2.7 on Centos 6.5","og_url":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/","og_site_name":"Supportex.NET blog","article_published_time":"2014-09-16T13:51:39+00:00","article_modified_time":"2019-05-10T13:05:20+00:00","author":"Oleksii Tykhonov","twitter_misc":{"Written by":"Oleksii Tykhonov","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#article","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/"},"author":{"name":"Oleksii Tykhonov","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"headline":"Installing Python 2.7 on Centos 6.5","datePublished":"2014-09-16T13:51:39+00:00","dateModified":"2019-05-10T13:05:20+00:00","mainEntityOfPage":{"@id":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/"},"wordCount":194,"commentCount":0,"keywords":["pyenv"],"articleSection":["linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/","url":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/","name":"Installing Python 2.7 on Centos 6.5 &#8211; Supportex.NET blog","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/en\/#website"},"datePublished":"2014-09-16T13:51:39+00:00","dateModified":"2019-05-10T13:05:20+00:00","author":{"@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"description":"How to instal Python 2.7 on Centos 6.5","breadcrumb":{"@id":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/supportex.net\/blog\/2014\/09\/installing-python-2-7-centos-6-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/supportex.net\/blog\/en\/"},{"@type":"ListItem","position":2,"name":"Installing Python 2.7 on Centos 6.5"}]},{"@type":"WebSite","@id":"https:\/\/supportex.net\/blog\/en\/#website","url":"https:\/\/supportex.net\/blog\/en\/","name":"Supportex.NET blog","description":"Server and network management company","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251","name":"Oleksii Tykhonov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","caption":"Oleksii Tykhonov"},"url":"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/"}]}},"_links":{"self":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/comments?post=2942"}],"version-history":[{"count":7,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2942\/revisions"}],"predecessor-version":[{"id":3127,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2942\/revisions\/3127"}],"wp:attachment":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/media?parent=2942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/categories?post=2942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/tags?post=2942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}