{"id":1838,"date":"2020-04-04T03:04:38","date_gmt":"2020-04-03T18:04:38","guid":{"rendered":"https:\/\/blog.minatoproject.com\/?p=1838"},"modified":"2020-04-11T01:11:17","modified_gmt":"2020-04-10T16:11:17","slug":"%e3%80%90python%e3%80%91windows%e3%81%a7%e8%a4%87%e6%95%b0%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3%e3%81%aepython%e3%82%92%e7%b0%a1%e5%8d%98%e3%81%8b%e3%81%a4%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3","status":"publish","type":"post","link":"https:\/\/blog.minatoproject.com\/?p=1838","title":{"rendered":"\u3010Python\u3011Windows\u3067\u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePython\u3092\u7c21\u5358\u304b\u3064\u30af\u30ea\u30fc\u30f3\u306b\u4f7f\u3046\u6211\u6d41\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9"},"content":{"rendered":"<div class=\"veu_autoEyeCatchBox\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_eyecatch-1024x576.png\" class=\"attachment-large size-large wp-post-image\" alt=\"\" srcset=\"https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_eyecatch-1024x576.png 1024w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_eyecatch-300x169.png 300w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_eyecatch-768x432.png 768w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_eyecatch-320x180.png 320w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div>\n<p>1\u30f6\u6708\u632f\u308a\u306e\u6295\u7a3f\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4ed5\u4e8b\u67c4\u3053\u3046\u3044\u3046\u306e\u306f\u30cd\u30bf\u304c\u306a\u3044\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3057\u3070\u3089\u304f\u591a\u5fd9\u3067\u3057\u3066\u30ce\u30a6\u30cf\u30a6\u3092\u3053\u3053\u307e\u3067\u6301\u3063\u3066\u304f\u308b\u524d\u306b\u529b\u5c3d\u304d\u308b\u6bce\u65e5\u3092\u904e\u3054\u3057\u3066\u304a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7d4c\u7def<\/h2>\n\n\n\n<p>\u3055\u3066\u3001\u4e45\u3005\u306b\uff1fPython\u306e\u304a\u8a71\u3067\u3059\u3002Windows\u3067Python\u306e\u74b0\u5883\u69cb\u7bc9\u3068\u3044\u3046\u3068\u4f55\u3068\u306a\u304fAnaconda\u304c\u4e3b\u6d41\u306a\u5370\u8c61\u304c\u3042\u3063\u3066\u3001\u591a\u5206\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u3082conda\u3092\u4f7f\u3063\u3066\u308b\u4eba\u304c\u591a\u3044\u3093\u3060\u308d\u3046\u306a\u3068\u306f\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u3082Windows 10\u3068Anaconda\u306e\u76f8\u6027\u304c\u60aa\u3044\u3088\u3046\u306a\u6c17\u304c\u3057\u3066\u3001\u8272\u3005\u63a2\u3063\u3066\u3044\u308b\u3046\u3061\u306b\u4f8b\u306b\u3088\u3063\u3066\u30cf\u30de\u3063\u305f\u306e\u3067\u7db4\u3063\u3066\u304a\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5927\u307e\u304b\u306a\u6307\u91dd<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Anaconda\u306f\u4f7f\u308f\u306a\u3044<\/li><li>\u8907\u6570\u306ePython 3\u3092\u500b\u5225\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/li><li>\u6975\u529b\u3001\u4eee\u60f3\u3058\u3083\u306a\u3044\u6839\u3063\u3053\u306e\u74b0\u5883\u306f\u5f04\u3089\u306a\u3044<\/li><li>\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u306b\u5fc5\u8981\u306a\u4f9d\u5b58\u95a2\u4fc2\u3092\u4ed6\u306e\u4eba\u306b\u3082\u7c21\u5358\u306b\u6e21\u305b\u308b\u3088\u3046\u306b\u3059\u308b<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">root\u74b0\u5883\u69cb\u7bc9<\/h2>\n\n\n\n<p>\u3042\u307e\u308a\u6c5a\u3057\u305f\u304f\u306a\u3044\u3068\u306f\u3044\u3048\u3001\u6700\u4f4e\u9650\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306f\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u308a\u3042\u3048\u305a\u516c\u5f0f\u304b\u3089<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Python 3.6.8<\/li><li>Python 3.7.7<\/li><li>Python 3.8.2<\/li><\/ul>\n\n\n\n<p>\u306e64bit\u7248\u3092\u5f15\u3063\u5f35\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3067\u3001\u5f53\u7136\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u3067PATH\u306f\u901a\u3055\u306a\u3044\u306b\u3057\u3066\u3082\u3001\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\u304a\u8a66\u3057\u3067\u52d5\u304b\u3057\u305f\u3044\u6642\u306f\u3069\u3046\u3057\u3066\u3082\u3042\u308b\u306e\u3067\u4ee3\u8868\u30673.7\u3060\u3051\u306fPATH\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_001.png\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"759\" src=\"http:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_001.png\" alt=\"\" class=\"wp-image-1840\" srcset=\"https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_001.png 682w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2020\/04\/20200404_001-270x300.png 270w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/a><\/figure>\n\n\n\n<p>\u5fc5\u8981\u306a\u8a2d\u5b9a\u306f<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>%LOCALAPPDATA%\\Programs\\Python\\Python37\n%LOCALAPPDATA%\\Programs\\Python\\Python37\\Scripts<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e2\u3064\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3057\u3001<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>%USERPROFILE%\\AppData\\Local\\Microsoft\\WindowsApps<\/code><\/pre><\/div>\n\n\n\n<p><span data-color=\"#fcb900\" style=\"background: linear-gradient(transparent 60%,rgba(252, 185, 0, 0.7) 0);\" class=\"vk_highlighter\">\u3053\u306e\u8a2d\u5b9a\u3088\u308a\u3082\u4e0a\u306b\u5165\u308c\u306a\u3044\u3068\u5b9f\u884c\u6642\u306b\u4f55\u6545\u304bMicrosoft\u30b9\u30c8\u30a2\u304c\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3046<\/span>\u306e\u3067\u8981\u6ce8\u610f\u3067\u3059\u3002<\/p>\n\n\n\n<p>pip\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\" data-file=\"PowerShell\"><code>$ python -m pip install --upgrade pip<\/code><\/pre><\/div>\n\n\n\n<p>virtualenv\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\" data-file=\"PowerShell\"><code>$ pip install virtualenv<\/code><\/pre><\/div>\n\n\n\n<p>root\u306b\u624b\u3092\u52a0\u3048\u308b\u306e\u306f\u3053\u3053\u307e\u3067\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4eee\u60f3\u74b0\u5883\u69cb\u7bc9<\/h2>\n\n\n\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u305f\u3081\u306e\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u308a\u3001\u305d\u3053\u3067\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\" data-file=\"PowerShell\"><code>$ python -m virtualenv -p &quot;$env:LOCALAPPDATA\\Programs\\Python\\Python37\\python.exe&quot; .env<\/code><\/pre><\/div>\n\n\n\n<p>\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\" data-file=\"PowerShell\"><code>$ .\\.env\\Scripts\\activate<\/code><\/pre><\/div>\n\n\n\n<p>\u8ab0\u304b\u306e\u74b0\u5883\u3092\u6301\u3063\u3066\u304d\u305f\u3068\u304d\u306f\u3053\u306e\u72b6\u614b\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4e00\u62ec\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\" data-file=\"PowerShell\"><code>(.env)$ pip install -r .\\requirements.txt<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">VSCode\u3067\u958b\u767a\u74b0\u5883\u3092\u6574\u3048\u308b<\/h2>\n\n\n\n<p>\u65b0\u3057\u304f\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u74b0\u5883\u3092\u4f5c\u3063\u3066\u3044\u304f\u5834\u5408\u306f\u4ee5\u964d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u8ffd\u52a0\u306a\u3069\u306fVSCode\u3067\u3084\u308b\u306e\u304c\u30e9\u30af\u3067\u3059\u3002<\/p>\n\n\n\n<p><code>.env<\/code> \u3067\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u3063\u305f\u5834\u5408\u3001VSCode\u3067\u65b0\u3057\u3044\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u3044\u305f\u6642\u70b9\u3067\u81ea\u52d5\u3067\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u304c\u8d70\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u307e\u305a\u3053\u308c\u304c\u3081\u3063\u3061\u3083\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3042\u3068\u306f\u3053\u3053\u3067\u3061\u304f\u3061\u304f <code>pip install<\/code> \u3057\u3066\u3044\u3063\u3066\u3001\u6700\u5f8c\u306brequirements.txt\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\" data-file=\"PowerShell\"><code>(.env) $ pip freeze &gt;&gt; requirements.txt<\/code><\/pre><\/div>\n\n\n\n<p>\u305f\u3060\u3057<span data-color=\"#fcb900\" style=\"background: linear-gradient(transparent 60%,rgba(252, 185, 0, 0.7) 0);\" class=\"vk_highlighter\">PowerShell\u3067\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c9\u304cUTF-16 LE\u306b\u306a\u3063\u3066\u3057\u307e\u3046<\/span>\u306e\u3067\u3001\u3053\u308c\u3092\u624b\u52d5\u3067UTF-8\u306b\u5909\u3048\u3066\u304a\u304d\u307e\u3059\u3002\u3053\u308c\u3082VSCode\u306a\u3089\u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc\u53f3\u5074\u306e\u300c\u30a8\u30f3\u30b3\u30fc\u30c9\u306e\u9078\u629e\u300d\u304b\u3089\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002\u306a\u304a\u3053\u306e\u554f\u984c\u306fgibo\u3068\u304b\u4f7f\u3063\u3066\u3066\u3082\u76f4\u9762\u3059\u308b\u3067\u3042\u308d\u3046\u554f\u984c\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3042\u3068\u306f\u521d\u3081\u3066Python\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3068\u304d\u306b\u300c\u3069\u306e\u74b0\u5883\u4f7f\u3044\u307e\u3063\u304b\u300d\u3068\u805e\u304b\u308c\u308b\u306e\u3067\u30d1\u30ec\u30c3\u30c8\u304b\u3089\u5165\u529b\u3059\u308b\u304b <code>.\\.vscode\\settings.json<\/code> \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8ffd\u52a0\u3059\u308c\u3070\u30c7\u30d0\u30c3\u30b0\u3082\u697d\u30c1\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-file=\"settings.json\" data-lang=\"JSON\"><code>{\n    &quot;python.pythonPath&quot;: &quot;.env\\\\Scripts\\\\python.exe&quot;\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u9593\u9055\u3063\u3066\u3082\u7d76\u5bfe\u30d1\u30b9\u306a\u3093\u3066\u99ac\u9e7f\u306a\u771f\u4f3c\u306f\u3084\u3081\u3066\u304f\u3060\u3055\u3044(\u7b11)<\/p>\n\n\n\n<p>\u3053\u308c\u3067 <code>.gitignore<\/code> \u3082gibo\u3067\u4f5c\u3063\u3066\u304a\u3051\u3070 <code>.env<\/code> \u3082git\u306e\u8ffd\u8de1\u304b\u3089\u9664\u5916\u3055\u308c\u3001<span data-color=\"#fcb900\" style=\"background: linear-gradient(transparent 60%,rgba(252, 185, 0, 0.7) 0);\" class=\"vk_highlighter\">\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3053\u3068\u306a\u304f\u3001requirements.txt\u3092\u7d4c\u7531\u3057\u3066\u5171\u901a\u5316\u3057\u305f\u624b\u9806\u3067\u4ed6\u306e\u4eba\u306b\u540c\u3058\u74b0\u5883\u3092\u63d0\u4f9b\u3067\u304d\u308b<\/span>\u308f\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3069\u3046\u3067\u3057\u3087\u3046\u3002\u6211\u306a\u304c\u3089\u7f8e\u3057\u3044\u30d7\u30ed\u30c8\u30b3\u30eb\u304c\u3067\u304d\u305f\u306a\u3001\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u5897\u3048\u308b\u3068\u4eee\u60f3\u74b0\u5883\u306e\u5206\u30c7\u30a3\u30b9\u30af\u3092\u98df\u3063\u3066\u3057\u307e\u3046\u306e\u306f\u3054\u611b\u5b0c\u3068\u3044\u3046\u3053\u3068\u3067\u3072\u3068\u3064\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u30f6\u6708\u632f\u308a\u306e\u6295\u7a3f\u3067\u3059\u3002 \u4ed5\u4e8b\u67c4\u3053\u3046\u3044\u3046\u306e\u306f\u30cd\u30bf\u304c\u306a\u3044\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3057\u3070\u3089\u304f\u591a\u5fd9\u3067\u3057\u3066\u30ce\u30a6\u30cf\u30a6\u3092\u3053\u3053\u307e\u3067\u6301\u3063\u3066\u304f\u308b\u524d\u306b\u529b\u5c3d\u304d\u308b\u6bce\u65e5\u3092\u904e\u3054\u3057\u3066\u304a\u308a\u307e\u3057\u305f\u3002 \u7d4c\u7def \u3055\u3066\u3001\u4e45\u3005\u306b\uff1fPython\u306e\u304a\u8a71\u3067\u3059\u3002Window [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1839,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-1838","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts\/1838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1838"}],"version-history":[{"count":7,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts\/1838\/revisions"}],"predecessor-version":[{"id":1847,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts\/1838\/revisions\/1847"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/media\/1839"}],"wp:attachment":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}