{"id":489,"date":"2019-11-20T22:32:00","date_gmt":"2019-11-20T13:32:00","guid":{"rendered":""},"modified":"2020-10-02T22:28:00","modified_gmt":"2020-10-02T13:28:00","slug":"centos7%e3%81%abpyenv","status":"publish","type":"post","link":"https:\/\/wp.zassoul.com\/?p=489","title":{"rendered":"CentOS7\u306bpyenv"},"content":{"rendered":"<p>\u305d\u308d\u305d\u308d\u771f\u9762\u76ee\u306bPython\u306b\u53d6\u308a\u639b\u304b\u308d\u3046\u3068\u3001\u74b0\u5883\u6e96\u5099\u306e\u4e00\u8cab\u3067\u7570\u306a\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePython\u74b0\u5883\u3092\u63c3\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308bpyenv\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8(GITHUB)<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/pyenv\/pyenv\" target=\"_blank\" rel=\"noopener noreferrer\">pyenv<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pyenv\/pyenv\/wiki\/common-build-problems\" target=\"_blank\" rel=\"noopener noreferrer\">\u4f9d\u5b58\u95a2\u4fc2<\/a><\/li>\n<\/ul>\n<h4>\u4f9d\u5b58\u95a2\u4fc2\u6e96\u5099<\/h4>\n<pre>$ sudo yum install @development zlib-devel bzip2 bzip2-devel readline-devel sqlite <br \/>sqlite-devel openssl-devel xz xz-devel libffi-devel findutils<br \/><\/pre>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<pre>$ git clone https:\/\/github.com\/pyenv\/pyenv.git ~\/.pyenv<br \/><\/pre>\n<h4>pyenv\u306ePATH\u8a2d\u5b9a<\/h4>\n<pre>$ echo 'export PYENV_ROOT=\"$HOME\/.pyenv\"' &gt;&gt; ~\/.bash_profile<br \/>$ echo 'export PATH=\"$PYENV_ROOT\/bin:$PATH\"' &gt;&gt; ~\/.bash_profile<br \/># Add pyenv init to your shell to enable shims and autocompletion. Please make sure eval \"$(pyenv init -)\" is placed toward the end of the shell configuration file since it manipulates PATH during the initialization.<br \/>$ echo -e 'if command -v pyenv 1>\/dev\/null 2>&1; thenn  eval \"$(pyenv init -)\"nfi' >> ~\/.bash_profile<br \/>$ source .\/.bash_profile<br \/><\/pre>\n<p>\u5b8c\u4e86\u3002  <\/p>\n<h4>\u78ba\u8a8d<\/h4>\n<p>\u73fe\u72b6\u30c1\u30a7\u30c3\u30af\u3002 <\/p>\n<pre>$ python -V<br \/>Python 2.7.5<br \/><\/pre>\n<p>pyenv \u30673.7.0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002  <\/p>\n<pre>$ pyenv install 3.7.0<br \/>Downloading Python-3.7.0.tar.xz...<br \/>-&gt; https:\/\/www.python.org\/ftp\/python\/3.7.0\/Python-3.7.0.tar.xz<br \/>Installing Python-3.7.0...<br \/>Installed Python-3.7.0 to \/home\/centos\/.pyenv\/versions\/3.7.0<br \/>$ pyenv versions<br \/>* system (set by \/home\/centos\/.pyenv\/version)<br \/>  3.7.0<br \/><\/pre>\n<p>script directory\u3060\u3051\u3092version 3.7.0 \u306b\u3059\u308b\u3002  <\/p>\n<pre>$ pwd<br \/>\/home\/centos\/script<br \/>$ pyenv local 3.7.0<br \/>$ pyenv versions<br \/>  system<br \/>* 3.7.0 (set by \/home\/centos\/script\/.python-version)<br \/>$ cd<br \/>$ pyenv versions<br \/>* system (set by \/home\/centos\/.pyenv\/version)<br \/>  3.7.0<br \/><\/pre>\n<p>\u3078\u30fc\u9762\u767d\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u308d\u305d\u308d\u771f\u9762\u76ee\u306bPython\u306b\u53d6\u308a\u639b\u304b\u308d\u3046\u3068\u3001\u74b0\u5883\u6e96\u5099\u306e\u4e00\u8cab\u3067\u7570\u306a\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePython\u74b0\u5883\u3092\u63c3\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308bpyenv\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002 \u516c\u5f0f\u30b5\u30a4\u30c8(GITHUB) pyenv \u4f9d\u5b58\u95a2\u4fc2 \u4f9d\u5b58\u95a2\u4fc2\u6e96\u5099 $ su\u2026 <span class=\"read-more\"><a href=\"https:\/\/wp.zassoul.com\/?p=489\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,31,32,8],"tags":[],"class_list":["post-489","post","type-post","status-publish","format-standard","hentry","category-it","category-pyenv","category-python","category-8"],"_links":{"self":[{"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=\/wp\/v2\/posts\/489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=489"}],"version-history":[{"count":1,"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=\/wp\/v2\/posts\/489\/revisions"}],"predecessor-version":[{"id":626,"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=\/wp\/v2\/posts\/489\/revisions\/626"}],"wp:attachment":[{"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.zassoul.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}