{"id":1124,"date":"2025-06-25T17:57:20","date_gmt":"2025-06-25T08:57:20","guid":{"rendered":"https:\/\/txn.myds.me\/blog\/?p=1124"},"modified":"2025-06-25T17:57:20","modified_gmt":"2025-06-25T08:57:20","slug":"windows-%e3%81%ae-pipenv-%e3%81%a7%e4%b8%8a%e4%b8%8b%e3%82%ad%e3%83%bc%e3%81%a7%e3%83%92%e3%82%b9%e3%83%88%e3%83%aa%e3%83%bc%e3%82%92%e3%81%9f%e3%81%a9%e3%82%8a%e3%81%9f%e3%81%84","status":"publish","type":"post","link":"https:\/\/blog.txn.red\/?p=1124","title":{"rendered":"Windows \u306e pipenv \u3067\u3082\u4e0a\u4e0b\u30ad\u30fc\u3067\u30d2\u30b9\u30c8\u30ea\u30fc\u3092\u305f\u3069\u308a\u305f\u3044"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u30bf\u30a4\u30c8\u30eb\u306e\u3068\u304a\u308a\u3067\u3059\u304c\u3001Windows \u306e powershell 7 \u3067 pipenv shell \u3059\u308b\u3068\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u5c65\u6b74\u304c\u305f\u3069\u308c\u306a\u304f\u306a\u308a\u306a\u3093\u3068\u304b\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30cd\u30c3\u30c8\u4e0a\u3092\u691c\u7d22\u3059\u308b\u3068\u3044\u304f\u3064\u304b\u56de\u907f\u7b56\u3092\u898b\u3064\u3051\u3089\u308c\u305f\u304c\u3069\u308c\u3082\u81ea\u5206\u306b\u306f\u3057\u3063\u304f\u308a\u3053\u306a\u304b\u3063\u305f\u306e\u3067\u3001Claude \u306b\u805e\u3044\u3066\u307f\u3066\u89e3\u6c7a\u7b56\u3092\u898b\u3064\u3051\u305f\u306e\u3067\u8a18\u4e8b\u306b\u3059\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u3082\u305d\u3082 pipenv shell \u3059\u308b\u3068 powershell \u306b\u3044\u308b\u306b\u3082\u95a2\u308f\u3089\u305a command \u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\u306e\u304c\u539f\u56e0\u3058\u3083\u306a\u3044\u304b\u3068\u63a8\u6e2c\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3044\u304f\u3064\u304b\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001<code>pipenv run pwsh<\/code> \u3067\u3001\u76f4\u63a5powershell \u3092\u8d77\u52d5\u3059\u308c\u3070\u3044\u3044\u7684\u306a\u3053\u3068\u3092\u66f8\u3044\u3066\u3044\u308b\u304c\u305d\u3046\u3059\u308b\u3068\u30d7\u30ed\u30f3\u30d7\u30c8\u6587\u5b57\u5217\u306e (VENV\u540d) \u304c\u6d88\u3048\u3066\u3057\u307e\u3046\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(VENV\u540d) \u306f venv \u30d5\u30a9\u30eb\u30c0\u306e Scripts \u306e\u4e2d\u306b\u3042\u308b activate.ps1 \u3084 activate.bat \u3092\u8d77\u52d5\u3059\u308b\u3068\u8868\u793a\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u6c7a\u7b56\u306f Claude \u304c\u8a00\u3046\u307e\u307e\u306b $PROFILE \u306b\u95a2\u6570\u3068\u30a8\u30ea\u30a2\u30b9\u3092\u5b9a\u7fa9\u3057\u3066\u3084\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-file=\"$PROFILE\" data-lang=\"Bash\"><code>\nfunction Invoke-PipenvPwsh {\n  $venv_path = pipenv --venv 2&gt;$null\n  if ($venv_path -and (Test-path &quot;$venv_path\\Scripts\\Activate.ps1&quot;)) {\n    & &quot;$venv_path\\Scripts\\Activate.ps1&quot;\n  } else {\n    Write-error &quot;Pipenv venv not found&quot;\n  }\n}\n\nSet-Alias pipenv-shell Invoke-PipenvPwsh\n\n; \u3053\u308c\u306f\u4e0d\u8981\u3060\u3051\u3069\u3001\u540d\u524d\u3092\u5bfe\u7167\u7684\u306b\u3059\u308b\u305f\u3081\u306b\u30a8\u30ea\u30a2\u30b9\u3092\u5b9a\u7fa9\nSet-Alias pipenv-exit deactivate\n<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53cd\u6620\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>; $PROFILE \u3092\u53cd\u6620\u3059\u308b\nPS &gt; . $PROFILE\n\n; pipenv shell \u306e\u5909\u308f\u308a\u306b pipenv-shell \u3067 activate.ps1  \u3092\u8d77\u52d5\u3059\u308b\nPS &gt; pipenv-shell\n(VENV \u540d)  PS &gt; \n\n; \u6ce8\u610f exit \u3057\u3061\u3083\u3046\u3068 shell \u305d\u306e\u3082\u306e\u304b\u3089\u629c\u3051\u3061\u3083\u3046\u306e\u3067  deactivate \u3067\u629c\u3051\u308b\n(VENV \u540d)  PS &gt;  deactivate<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">function \u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u7279\u5225\u96e3\u3057\u3044\u3053\u3068\u3067\u306f\u306a\u304f\u3066\u3001 pipenv &#8211;venv \u3067 venv \u306e\u5834\u6240\u3092\u53d6\u5f97\u3057\u3066\u3001\u305d\u306e\u306a\u304b\u306e activate.ps1 \u3092\u8d77\u52d5\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">win \/ Linux \u306b\u9650\u3089\u305a shell \u95a2\u4fc2\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7a7a\u3067\u66f8\u304f\u306e\u3063\u3066\u7d50\u69cb\u9762\u5012\u3060\u304b\u3089\u307b\u3093\u3068 Claude \u306b\u983c\u308a\u304d\u308a\u3060\u3002\u3053\u3046\u3084\u3063\u3066\u4eba\u306f AI \u306e\u5974\u96b7\u306b\u306a\u3063\u3066\u3044\u304f\u306e\u304b\u3068\u601d\u3063\u3066\u307f\u305f\u308a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3068\u3082\u3042\u308c\u3001\u3053\u308c\u3067\u3061\u3087\u3063\u3068\u3044\u3044\u611f\u3058\u306b\u306a\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30bf\u30a4\u30c8\u30eb\u306e\u3068\u304a\u308a\u3067\u3059\u304c\u3001Windows \u306e powershell 7 \u3067 pipenv shell \u3059\u308b\u3068\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u5c65\u6b74\u304c\u305f\u3069\u308c\u306a\u304f\u306a\u308a\u306a\u3093\u3068\u304b\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u305f\u3002 \u30cd\u30c3\u30c8\u4e0a\u3092\u691c\u7d22\u3059\u308b\u3068\u3044\u304f\u3064\u304b\u56de\u907f\u7b56\u3092\u898b\u3064\u3051\u3089\u308c\u305f\u304c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[9],"tags":[14],"class_list":["post-1124","post","type-post","status-publish","format-standard","hentry","category-dev","tag-python"],"_links":{"self":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/1124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1124"}],"version-history":[{"count":0,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/1124\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}