{"id":1086,"date":"2016-11-02T14:33:00","date_gmt":"2016-11-02T14:33:00","guid":{"rendered":"https:\/\/rawbytes.org\/?p=1086"},"modified":"2025-11-24T02:59:44","modified_gmt":"2025-11-24T02:59:44","slug":"homebrew%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%9fpyenv%e3%81%ae%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%ef%bc%88el-captanzsh%ef%bc%89","status":"publish","type":"post","link":"https:\/\/rawbytes.org\/?p=1086","title":{"rendered":"Homebrew\u3092\u4f7f\u3063\u305fpyenv\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\uff08El Captan+zsh\uff09"},"content":{"rendered":"<p>Homebrew\u3092\u4f7f\u3063\u305fzsh+prezto\u74b0\u5883\u3067\u306epyenv\u306e\u69cb\u7bc9\u624b\u9806\u30e1\u30e2\u3002<\/p>\n<p>1. pyenv\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n$ brew update<br \/>\n$ brew install pyenv<\/p>\n<p>2. \u74b0\u5883\u5909\u6570\u306e\u8a2d\u5b9a<br \/>\n.zshrc\u306b\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3059\u308b\u3002Prezto\u306e\u5834\u5408\u306f\u3069\u3053\u306b\u72ec\u81ea\u8a2d\u5b9a\u3092\u66f8\u3051\u3070\u3044\u3044\u3093\u3060\u308d\u3046\u3068\u601d\u3063\u305f\u3093\u3060\u3051\u3069\u3001\u666e\u901a\u306b.zshrc\u306b\u66f8\u3051\u3070\u3044\u3044\u3089\u3057\u3044\u304b\u3089Prezto\u306f\u3042\u3093\u307e\u308a\u95a2\u4fc2\u306a\u304b\u3063\u305f\u3002<\/p>\n<blockquote class=\"tr_bq\"><p>\n<span class=\"s2\">if which pyenv &gt; \/dev\/null; then eval &#8220;$(pyenv init -)&#8221;; fi<\/span><\/p><\/blockquote>\n<p>3. python\u74b0\u5883\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f7f\u3048\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306fsystem\u306e\u307f\u3002<br \/>\n\u8ffd\u52a0\u3067\u304d\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u4ee5\u4e0b\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<blockquote class=\"tr_bq\"><p>\n$ pyenv install -l<\/p><\/blockquote>\n<p>\u3067\u78ba\u8a8d\u3057\u305f\u3042\u3068\u3001<\/p>\n<blockquote class=\"tr_bq\"><p>\n$ pyenv install 2.7.12<\/p><\/blockquote>\n<p>\u307f\u305f\u3044\u306b\u3057\u3066\u4efb\u610f\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002 pyenv\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u307f\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f<\/p>\n<blockquote class=\"tr_bq\"><p>\n$ pyenv versions<\/p><\/blockquote>\n<p>\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002 \u4efb\u610f\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067<\/p>\n<blockquote class=\"tr_bq\"><p>\n$ pyenv local 2.7.12<\/p><\/blockquote>\n<p>\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b.python-version\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u3089\u308c\u3001\u3053\u308c\u304c\u53cd\u6620\u3055\u308c\u3066\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u3067python\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u6642\u3060\u3051\u305d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePython\u3067\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u629c\u3051\u308b\u3068global\u306apython\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u81ea\u52d5\u3067\u5207\u308a\u66ff\u308f\u308b\u3002global\u306a\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b\u3068\u304d\u306f<\/p>\n<blockquote class=\"tr_bq\"><p>\n$ pyenv global 2.7.12<\/p><\/blockquote>\n<p>\u3068\u3059\u308b\u3068\u3001\u30ed\u30fc\u30ab\u30eb\u306b.python-version\u304c\u306a\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u5b9f\u884c\u3055\u308c\u308b\uff08global\u306a\uff09python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Homebrew\u3092\u4f7f\u3063\u305fzsh+prezto\u74b0\u5883\u3067\u306epyenv\u306e\u69cb\u7bc9\u624b\u9806\u30e1\u30e2\u3002 1. pyenv\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb $ brew update $ brew install pyenv 2. \u74b0\u5883\u5909\u6570\u306e\u8a2d\u5b9a .zshrc\u306b\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3059\u308b\u3002Prezto\u306e\u5834\u5408\u306f\u3069\u3053\u306b\u72ec\u81ea\u8a2d\u5b9a\u3092\u66f8\u3051\u3070\u3044\u3044\u3093\u3060\u308d\u3046\u3068\u601d\u3063\u305f\u3093\u3060\u3051\u3069\u3001\u666e\u901a\u306b.zshrc\u306b\u66f8\u3051\u3070\u3044\u3044\u3089\u3057\u3044\u304b\u3089Prezto\u306f\u3042\u3093\u307e\u308a\u95a2\u4fc2\u306a\u304b\u3063\u305f\u3002 if which pyenv &gt; \/dev\/null; then eval &#8220;$(pyenv init -)&#8221;; fi 3. python\u74b0\u5883\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f7f\u3048\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306fsystem\u306e\u307f\u3002 \u8ffd\u52a0\u3067\u304d\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u4ee5\u4e0b\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002 $ pyenv install -l \u3067\u78ba\u8a8d\u3057\u305f\u3042\u3068\u3001 $ pyenv install 2.7.12 \u307f\u305f\u3044\u306b\u3057\u3066\u4efb\u610f\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002 pyenv\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u307f\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f $ pyenv versions \u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002 \u4efb\u610f\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067 $ pyenv local 2.7.12 \u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b.python-version\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u3089\u308c\u3001\u3053\u308c\u304c\u53cd\u6620\u3055\u308c\u3066\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u3067python\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u6642\u3060\u3051\u305d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePython\u3067\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u629c\u3051\u308b\u3068global\u306apython\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u81ea\u52d5\u3067\u5207\u308a\u66ff\u308f\u308b\u3002global\u306a\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b\u3068\u304d\u306f $ pyenv global 2.7.12 \u3068\u3059\u308b\u3068\u3001\u30ed\u30fc\u30ab\u30eb\u306b.python-version\u304c\u306a\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u5b9f\u884c\u3055\u308c\u308b\uff08global\u306a\uff09python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,32],"tags":[],"class_list":["post-1086","post","type-post","status-publish","format-standard","hentry","category-howto","category-python"],"_links":{"self":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/1086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1086"}],"version-history":[{"count":1,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/1086\/revisions"}],"predecessor-version":[{"id":1087,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/1086\/revisions\/1087"}],"wp:attachment":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}