{"id":1621,"date":"2026-01-12T19:04:05","date_gmt":"2026-01-12T10:04:05","guid":{"rendered":"https:\/\/hi3103.net\/notes\/?p=1621"},"modified":"2026-01-12T22:52:39","modified_gmt":"2026-01-12T13:52:39","slug":"pyenv-%e3%81%a7-python-%e3%82%92%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3%e7%ae%a1%e7%90%86%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/hi3103.net\/notes\/dev\/1621","title":{"rendered":"pyenv \u3067 python \u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3059\u308b"},"content":{"rendered":"<h3>\u6982\u8981<\/h3>\n<ul>\n<li>\u30d6\u30e9\u30a6\u30b6\u64cd\u4f5c\u306e\u81ea\u52d5\u5316\u306b\u969b\u3057\u3066Python\u3092\u4f7f\u3044\u305f\u3044<\/li>\n<li>\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30c4\u30fc\u30eb\u3092\u5229\u7528\u3057\u305f\u307b\u3046\u304c\u5f8c\u3067\u82e6\u52b4\u3057\u306a\u3055\u305d\u3046\u306a\u306e\u3067\u3001phenv \u7d4c\u7531\u3067\u4efb\u610f\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u00a0python \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30fb\u5207\u308a\u66ff\u3048\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f<\/li>\n<\/ul>\n<h3>\u5c0e\u5165\u3059\u308b\u3082\u306e<\/h3>\n<ul>\n<li>GitHub &#8211; pyenv\/pyenv: Simple Python version management\n<ul>\n<li><a href=\"https:\/\/github.com\/pyenv\/pyenv\">https:\/\/github.com\/pyenv\/pyenv<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h3>\u4f5c\u696d\u30ed\u30b0<\/h3>\n<h4>pyenv\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>Homebrew \u3092\u4f7f\u3046\u305f\u3081\u3001\u5148\u306b\u00a0update \u3092\u304b\u3051\u308b<\/p>\n<pre><code class=\"language-bash\">brew update<\/code><\/pre>\n<p>pyenv \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre><code class=\"language-bash\">brew install pyenv<\/code><\/pre>\n<h4>pyenv\u7d4c\u7531\u3067python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<h5>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4e00\u89a7\u3067\u78ba\u8a8d<\/h5>\n<pre><code class=\"language-bash\">pyenv install -l<\/code><\/pre>\n<p>2026\u5e741\u670812\u65e5\u73fe\u5728\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306f 3.14.2<br \/>\n\u53c2\u8003\uff1a<a href=\"https:\/\/www.python.org\/downloads\/\">https:\/\/www.python.org\/downloads\/<\/a><\/p>\n<p>\u524d\u8ff0\u306e\u30b3\u30de\u30f3\u30c9\u306b grep \u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u8a72\u5f53\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n<pre><code class=\"language-bash\"> % pyenv install -l | grep 3.14.2\n  3.14.2\n  3.14.2t<\/code><\/pre>\n<h5>\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n<pre><code class=\"language-bash\">pyenv install 3.14.2<\/code><\/pre>\n<p>\u5b9f\u884c\u30ed\u30b0\u306f\u4ee5\u4e0b<\/p>\n<pre><code class=\"language-bash\">% pyenv install 3.14.2\npython-build: use openssl@3 from homebrew\npython-build: use readline from homebrew\nDownloading Python-3.14.2.tar.xz...\n-&gt; https:\/\/www.python.org\/ftp\/python\/3.14.2\/Python-3.14.2.tar.xz\nInstalling Python-3.14.2...\npython-build: use readline from homebrew\npython-build: use zlib from xcode sdk\nTraceback (most recent call last):\n  File \"&lt;string&gt;\", line 1, in &lt;module&gt;\n    import lzma\n  File \"\/Users\/hi3103\/.pyenv\/versions\/3.14.2\/lib\/python3.14\/lzma.py\", line 28, in &lt;module&gt;\n    from _lzma import *\nModuleNotFoundError: No module named '_lzma'\nWARNING: The Python lzma extension was not compiled. Missing the lzma lib?\nInstalled Python-3.14.2 to \/Users\/hi3103\/.pyenv\/versions\/3.14.2<\/code><\/pre>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u78ba\u8a8d<\/h4>\n<pre><code class=\"language-bash\">pyenv versions<\/code><\/pre>\n<p>\u5b9f\u884c\u30ed\u30b0\u306f\u4ee5\u4e0b<\/p>\n<pre><code class=\"language-bash\">% pyenv versions\n* system (set by \/Users\/hi3103\/.pyenv\/version)\n  3.14.2<\/code><\/pre>\n<h4>python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5207\u308a\u66ff\u3048\u308b\u65b9\u6cd5<\/h4>\n<p>\u9069\u7528\u3057\u305f\u3044\u7bc4\u56f2\u306b\u3042\u308f\u305b\u3066\u4ee5\u4e0b\u3092\u5b9f\u884c\u3059\u308b<br \/>\n\u4f8b\uff1a\u30d0\u30fc\u30b8\u30e7\u30f3 3.14.2 \u3092\u6307\u5b9a\u3059\u308b\u5834\u5408<\/p>\n<h5>\u73fe\u5728\u306e\u30b7\u30a7\u30eb\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u5bfe\u3057\u3066\u6307\u5b9a<\/h5>\n<pre><code>pyenv shell 3.14.2<\/code><\/pre>\n<h5>\u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306b\u5bfe\u3057\u3066\u6307\u5b9a<\/h5>\n<pre><code class=\"language-bash\">pyenv local 3.14.2<\/code><\/pre>\n<h5>\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u6307\u5b9a<\/h5>\n<pre><code class=\"language-bash\">pyenv global 3.14.2<\/code><\/pre>\n<h4>\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u30b3\u30de\u30f3\u30c9\u3092\u8a2d\u5b9a<\/h4>\n<h5>\u3084\u308b\u3053\u3068<\/h5>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fPython\u306f\u4ee5\u4e0b\u306e\u30d1\u30b9\u306b\u914d\u7f6e\u3055\u308c\u308b<\/p>\n<pre><code class=\"language-bash\">\/Users\/\u30e6\u30fc\u30b6\u30fc\u540d\/.pyenv\/versions\/\u30d0\u30fc\u30b8\u30e7\u30f3<\/code><\/pre>\n<p>python \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3068\u304d\u306b\u4e0a\u8a18\u3092\u547c\u3073\u51fa\u305b\u308b\u3088\u3046\u3001<a href=\"https:\/\/github.com\/pyenv\/pyenv?tab=readme-ov-file#b-set-up-your-shell-environment-for-pyenv\">\u516c\u5f0fREADME<\/a>\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u30b3\u30de\u30f3\u30c9\u3092 .zshrc \u306b\u8ffd\u52a0\u3059\u308b<\/p>\n<h5>\u6e96\u5099<\/h5>\n<p>\u73fe\u72b6\u30b7\u30a7\u30eb\u306e\u4e2d\u3067\u3001pyenv \u7d4c\u7531\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f Python \u3092\u4f7f\u3046\u72b6\u614b\u306b\u3059\u308b<\/p>\n<pre><code>pyenv shell 3.14.2<\/code><\/pre>\n<p>\u9078\u629e\u3067\u304d\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n<pre><code class=\"language-bash\">pyenv versions<\/code><\/pre>\n<pre><code class=\"language-bash\">% pyenv versions\n  system\n* 3.14.2 (set by PYENV_VERSION environment variable)<\/code><\/pre>\n<h5>\u73fe\u72b6\u3092\u78ba\u8a8d<\/h5>\n<p>python \u30b3\u30de\u30f3\u30c9\u304c\u52d5\u304f\u304b\u3092\u78ba\u8a8d<\/p>\n<pre><code class=\"language-bash\">python --version<\/code><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u3068\u8a00\u308f\u308c\u308b\u306e\u3067\u3001\u3053\u308c\u304b\u3089\u3053\u306e\u72b6\u614b\u3092\u89e3\u6d88\u3059\u308b<\/p>\n<pre><code class=\"language-bash\">% python --version\nzsh: command not found: python<\/code><\/pre>\n<h5>.zshrc \u306b\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0<\/h5>\n<p>.zshrc \u306e\u7de8\u96c6\u753b\u9762\u3092\u958b\u304f<\/p>\n<pre><code class=\"language-bash\">vi ~\/.zshrc<\/code><\/pre>\n<p>\u4ee5\u4e0b\u3092\u8a18\u8f09\u3057\u3066\u4fdd\u5b58<\/p>\n<pre><code class=\"language-bash\"># pyenv\nexport PYENV_ROOT=\"$HOME\/.pyenv\"\n[[ -d $PYENV_ROOT\/bin ]] &amp;&amp; export PATH=\"$PYENV_ROOT\/bin:$PATH\"\neval \"$(pyenv init - zsh)\"<\/code><\/pre>\n<p>.zshrc \u3092\u518d\u8aad\u307f\u8fbc\u307f<\/p>\n<pre><code class=\"language-bash\">source ~\/.zshrc<\/code><\/pre>\n<h5>\u53cd\u6620\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d<\/h5>\n<p>python \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n<pre><code class=\"language-bash\">% python --version\nPython 3.14.2<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u30d6\u30e9\u30a6\u30b6\u64cd\u4f5c\u306e\u81ea\u52d5\u5316\u306b\u969b\u3057\u3066Python\u3092\u4f7f\u3044\u305f\u3044 \u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30c4\u30fc\u30eb\u3092\u5229\u7528\u3057\u305f\u307b\u3046\u304c\u5f8c\u3067\u82e6\u52b4\u3057\u306a\u3055\u305d\u3046\u306a\u306e\u3067\u3001phenv \u7d4c\u7531\u3067\u4efb\u610f\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u00a0python \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30fb\u5207\u308a\u66ff\u3048\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f \u5c0e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93],"tags":[110,40,15],"class_list":["post-1621","post","type-post","status-publish","format-standard","hentry","category-dev","tag-mac-os-tahoe","tag-python","tag-terminal"],"_links":{"self":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/comments?post=1621"}],"version-history":[{"count":0,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1621\/revisions"}],"wp:attachment":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/media?parent=1621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/categories?post=1621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/tags?post=1621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}