{"id":2681,"date":"2018-05-10T09:56:34","date_gmt":"2018-05-10T00:56:34","guid":{"rendered":"https:\/\/akamist.com\/blog\/?p=2681"},"modified":"2018-05-12T10:00:38","modified_gmt":"2018-05-12T01:00:38","slug":"macos%e3%81%a7pyenv%e3%82%92%e4%bd%bf%e3%81%862018%e5%b9%b4-macos-high-sierra","status":"publish","type":"post","link":"https:\/\/akamist.com\/blog\/archives\/2681","title":{"rendered":"macOS\u3067pyenv\u3092\u4f7f\u3046[2018\u5e74, macOS High Sierra]"},"content":{"rendered":"<p>python\u3067\u306fpyenv\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001python2\u7cfb\u3068python3\u7cfb\u3092\u5171\u5b58\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u3053\u306epyenv\u3092macOS\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u5225\u30d0\u30fc\u30b8\u30e7\u30f3\u306epython\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>\u5b9f\u884c\u74b0\u5883<\/h2>\n<p>macOS High Sierra10.13.4<br \/>\nbrew\u3067\u3001git\u30b3\u30de\u30f3\u30c9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f<\/p>\n<h2>\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9<\/h2>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u9806\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\/\u5225\u30d0\u30fc\u30b8\u30e7\u30f3\u306epython\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\/\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u5207\u308a\u66ff\u3048\u307e\u3067\u884c\u3048\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\"># get pyenv\ngit clone git:\/\/github.com\/yyuu\/pyenv.git ~\/.pyenv\n\n# edit bash_profile\necho ''                                    &gt;&gt; ~\/.bash_profile\necho '#pyenv'                              &gt;&gt; ~\/.bash_profile\necho 'export PYENV_ROOT=\"$HOME\/.pyenv\"'    &gt;&gt; ~\/.bash_profile\necho 'export PATH=\"$PYENV_ROOT\/bin:$PATH\"' &gt;&gt; ~\/.bash_profile\necho 'eval \"$(pyenv init -)\"'              &gt;&gt; ~\/.bash_profile\n\n# check bash_profile\ncat ~\/.bash_profile\n\n# enable bash_profile\nsource ~\/.bash_profile\n\n# install latest 3.6.x\npyenv install --list\npyenv install 3.6.5\n\n# check installed\npyenv versions\n\n\n# change python version\npyenv rehash\npyenv global 3.6.5\n\n# check python version\npyenv versions\npython --version\nwhich python\n<\/code><\/pre>\n<h2>\u5b9f\u884c\u7d50\u679c\u306e\u30ed\u30b0<\/h2>\n<pre><code class=\"language-bash\">$ python --version\nPython 2.7.14\n\n\n$ git clone git:\/\/github.com\/yyuu\/pyenv.git ~\/.pyenv\nCloning into '\/Users\/xxx\/.pyenv'...\nremote: Counting objects: 16344, done.\nremote: Compressing objects: 100% (70\/70), done.\nremote: Total 16344 (delta 57), reused 85 (delta 42), pack-reused 16226\nReceiving objects: 100% (16344\/16344), 3.14 MiB | 712.00 KiB\/s, done.\nResolving deltas: 100% (11099\/11099), done.\n\n\n\n$ echo '' &gt;&gt; ~\/.bash_profile\n$ echo '#pyenv' &gt;&gt; ~\/.bash_profile\n$ echo 'export PYENV_ROOT=\"$HOME\/.pyenv\"' &gt;&gt; ~\/.bash_profile\n$ echo 'export PATH=\"$PYENV_ROOT\/bin:$PATH\"' &gt;&gt; ~\/.bash_profile\n$ echo 'eval \"$(pyenv init -)\"' &gt;&gt; ~\/.bash_profile\n\n\n\n#pyenv\nexport PYENV_ROOT=\"$HOME\/.pyenv\"\nexport PATH=\"$PYENV_ROOT\/bin:$PATH\"\neval \"$(pyenv init -)\"\n\n\n$ pyenv\n-bash: pyenv: command not found\n\n\n$ source ~\/.bash_profile\n$ pyenv\npyenv 1.2.4-1-ga2d5132\n\nUsage: pyenv &lt;command&gt; [&lt;args&gt;]\n\nSome useful pyenv commands are:\n   commands    List all available pyenv commands\n   local       Set or show the local application-specific Python version\n   global      Set or show the global Python version\n   shell       Set or show the shell-specific Python version\n   install     Install a Python version using python-build\n   uninstall   Uninstall a specific Python version\n   rehash      Rehash pyenv shims (run this after installing executables)\n   version     Show the current Python version and its origin\n   versions    List all Python versions available to pyenv\n   which       Display the full path to an executable\n   whence      List all Python versions that contain the given executable\n\nSee `pyenv help &lt;command&gt;' for information on a specific command.\nFor full documentation, see: https:\/\/github.com\/pyenv\/pyenv#readme\n\n\n\n$ pyenv versions\n* system (set by \/Users\/xxx\/.pyenv\/version)\n\n\n\n$ pyenv install --list\nAvailable versions:\n  2.1.3\n  2.2.3\n  ...\n  3.6.0\n  3.6-dev\n  3.6.1\n  3.6.2\n  3.6.3\n  3.6.4\n  3.6.5\n  3.7.0b4\n  3.7-dev\n  3.8-dev\n  ...\n\n\n\n$ pyenv install 3.6.5\npython-build: use openssl from homebrew\npython-build: use readline from homebrew\nDownloading Python-3.6.5.tar.xz...\n-&gt; https:\/\/www.python.org\/ftp\/python\/3.6.5\/Python-3.6.5.tar.xz\nInstalling Python-3.6.5...\npython-build: use readline from homebrew\nInstalled Python-3.6.5 to \/Users\/xxx\/.pyenv\/versions\/3.6.5\n\n\n\n$ pyenv versions\n* system (set by \/Users\/xxx\/.pyenv\/version)\n  3.6.5\n\n\n\n$ pyenv rehash\n$ pyenv global 3.6.5\n$ pyenv versions\n  system\n* 3.6.5 (set by \/Users\/xxx\/.pyenv\/version)\n\n$ python --version\nPython 3.6.5\n\n$ which python\n\/Users\/xxx\/.pyenv\/shims\/python\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>python\u3067\u306fpyenv\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001python2\u7cfb\u3068python3\u7cfb\u3092\u5171\u5b58\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u4eca\u56de\u306f\u3001\u3053\u306epyenv\u3092macOS\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u5225\u30d0\u30fc\u30b8\u30e7\u30f3\u306epython\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u5b9f\u884c\u74b0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2612,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[45],"tags":[177,172],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/akamist.com\/blog\/wp-content\/uploads\/2018\/05\/icon_python.png","jetpack-related-posts":[{"id":2610,"url":"https:\/\/akamist.com\/blog\/archives\/2610","url_meta":{"origin":2681,"position":0},"title":"[python]pyenv\u304c\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5207\u308a\u66ff\u3048\u308b\u4ed5\u7d44\u307f\u3092\u7406\u89e3\u3059\u308b","date":"2018\u5e745\u67085\u65e5","format":false,"excerpt":"python\u3067\u306fpyenv\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u4f7f\u3046\u3053\u3068\u3067\u30011\u53f0\u306ePC\u306b\u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u306epython\u74b0\u5883\u3092\u5171\u2026","rel":"","context":"python","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2018\/05\/icon_python.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5415,"url":"https:\/\/akamist.com\/blog\/archives\/5415","url_meta":{"origin":2681,"position":1},"title":"macOS\u3067brew\/pyenv\u3092\u4f7f\u3063\u3066python2\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b","date":"2022\u5e744\u67086\u65e5","format":false,"excerpt":"macOS\u3067`python2`\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u305f\u304f\u3066\u3001brew\u7d4c\u7531\u3067python2.x\u306e\u74b0\u5883\u3092\u7528\u610f\u3057\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2639,"url":"https:\/\/akamist.com\/blog\/archives\/2639","url_meta":{"origin":2681,"position":2},"title":"[NLP]Vagrant\u3067Python3\u304b\u3089MeCab\u4f7f\u3048\u308b\u74b0\u5883\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7","date":"2018\u5e745\u67085\u65e5","format":false,"excerpt":"AmazonLinux\u3067\u3001Python3\u304b\u3089\u5f62\u614b\u7d20\u89e3\u6790\u30e9\u30a4\u30d6\u30e9\u30ea\u306eMeCab\u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u30bb\u30c3\u30c8\u30a2\u2026","rel":"","context":"MeCab","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2018\/05\/icon_mecab.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3908,"url":"https:\/\/akamist.com\/blog\/archives\/3908","url_meta":{"origin":2681,"position":3},"title":"[CentOS8]Ansible\u3067\u30a8\u30e9\u30fc[\/bin\/sh: \/usr\/bin\/python: No such file or directory]\u304c\u51fa\u308b\u6642","date":"2020\u5e743\u670815\u65e5","format":false,"excerpt":"## \u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc \u624b\u5143\u306emacOS\u304b\u3089CentOS8.0\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3088\u3046\u3068ansible\u30b3\u30de\u2026","rel":"","context":"Ansible","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2017\/06\/icon_ansible.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2617,"url":"https:\/\/akamist.com\/blog\/archives\/2617","url_meta":{"origin":2681,"position":4},"title":"python\u3067MeCab\u3092\u4f7f\u304a\u3046\u3068\u3057\u3066\u30cf\u30de\u3063\u305f\u70b9\u3068\u89e3\u6c7a\u65b9\u6cd5\u306e\u307e\u3068\u3081","date":"2018\u5e745\u67085\u65e5","format":false,"excerpt":"python\u3067MeCab\u3092\u4f7f\u304a\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3001\u3044\u308d\u3044\u3068\u30a8\u30e9\u30fc\u304c\u3067\u3066\u30cf\u30de\u3063\u305f\u306e\u3067\u3001\u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u2026","rel":"","context":"MeCab","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2018\/05\/icon_mecab.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2650,"url":"https:\/\/akamist.com\/blog\/archives\/2650","url_meta":{"origin":2681,"position":5},"title":"[python]scikit-learn\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u5fc5\u8981\u306a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u5bb9\u91cf","date":"2018\u5e745\u67086\u65e5","format":false,"excerpt":"python\u306escikit-learn\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u306b\u5fc5\u8981\u3060\u3063\u305f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u2026","rel":"","context":"python","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2018\/05\/icon_python.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/2681"}],"collection":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/comments?post=2681"}],"version-history":[{"count":3,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/2681\/revisions"}],"predecessor-version":[{"id":2684,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/2681\/revisions\/2684"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/media\/2612"}],"wp:attachment":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/media?parent=2681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/categories?post=2681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/tags?post=2681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}