{"id":5112,"date":"2022-04-06T17:28:55","date_gmt":"2022-04-06T08:28:55","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=5112"},"modified":"2024-11-11T08:41:39","modified_gmt":"2024-11-10T23:41:39","slug":"pythonwindows-python-exe-%e3%81%8c%e5%ae%9f%e8%a1%8c%e3%81%a7%e3%81%8d%e3%81%aa%e3%81%84","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/5112","title":{"rendered":"[python][windows] python.exe \u304c\u5b9f\u884c\u3067\u304d\u306a\u3044"},"content":{"rendered":"<h3>1. \u75c7\u72b6<\/h3>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089Python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306b\u3082\u304b\u304b\u308f\u3089\u305a python (python3) \u304c\u5b9f\u884c\u3067\u304d\u306a\u3044\u3002<\/p>\n<h4>1.1. Microsoft Store\u3078\u306e\u30ea\u30f3\u30af\u304c\u958b\u304f<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/chihayafuru.s3-ap-northeast-1.amazonaws.com\/imgs\/wp\/2022\/04\/Python_in_MicrosoftStore.png\" alt=\"Microsoft Store\" width=\"360px\"><\/p>\n<p><a href=\"https:\/\/www.microsoft.com\/p\/python-37\/9nj46sx7x90p?activetab=pivot:overviewtab\">Microsoft Store\u306ePython\u3078\u306e\u30ea\u30f3\u30af<\/a> \u304c\u958b\u304f\u3002<\/p>\n<h4>1.2. \u30a2\u30af\u30bb\u30b9\u9055\u53cd\u304c\u767a\u751f\u3059\u308b<\/h4>\n<pre class=\"lang:default highlight:0 decode:true \" >$ python3 hello.py\r\nbash: \/c\/Users\/UserName\/AppData\/Local\/Microsoft\/WindowsApps\/python3: Permission denied<\/pre>\n<p>bash\u30b3\u30f3\u30bd\u30fc\u30eb\uff08\u2260WSL\uff09\u304b\u3089\u958b\u304f\u3068\u30a2\u30af\u30bb\u30b9\u9055\u53cd\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<p><!--more--><\/p>\n<h3>2. \u539f\u56e0<\/h3>\n<ol>\n<li>\u300e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u300f python.exe \u3078\u306e path \u304c\u901a\u3063\u3066\u3044\u306a\u3044\uff08\u30d1\u30b9\u8a2d\u5b9a\u3067\u304d\u3066\u3044\u306a\u3044\uff09\u3002<\/li>\n<li>Windows 10 \u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\uff0f\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u308b\u306e\u306f Microsoft Store \u306e Python \u30da\u30fc\u30b8\u3078\u306e\u8a98\u5c0e\u3059\u308b python.exe \u3067\u3042\u308b\u3002<\/li>\n<li>Python \u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u52d5\u304f\uff0f\u52d5\u304b\u306a\u3044\u3001\u3068\u3044\u3046\u4e92\u63db\u6027\u306e\u554f\u984c\u304c\u80cc\u666f\u306b\u3042\u308b\u305f\u3081\u3001Python\u30e9\u30f3\u30c1\u30e3\u30fc py.exe \u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5207\u63db\u3048\u308b\u4ed5\u7d44\u307f\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/li>\n<\/ol>\n<h3>3. \u89e3\u6c7a\u7b56<\/h3>\n<h4>3.1. Python\u30e9\u30f3\u30c1\u30e3\u30fc py.exe \u304b\u3089\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3002<\/h4>\n<h5>3.1.1. \u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u4f8b<\/h5>\n<pre class=\"lang:default highlight:0 decode:true \" >$ py hello.py<\/pre>\n<h5>3.1.2. Python\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<\/h5>\n<pre class=\"lang:default highlight:0 decode:true \" >$ py --version<\/pre>\n<h5>3.1.3. pip\u306b\u3088\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n<pre class=\"lang:default highlight:0 decode:true \" >py -m pip install pillow<\/pre>\n<p>pip\u30b3\u30de\u30f3\u30c9\u3092\u76f4\u63a5\u547c\u3073\u51fa\u3059\u306e\u3067\u306f\u306a\u304f\u3001py.exe &rArr; \u307b\u307c\u6700\u65b0\u7248 python.exe &rArr; \u307b\u307c\u6700\u65b0\u7248 pip\u30e2\u30b8\u30e5\u30fc\u30eb \u3068\u7d4c\u7531\u3057\u3066\u547c\u3073\u51fa\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u7279\u5b9a\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e python.exe, pip.exe \u306bPATH\u3092\u901a\u3059\u5fc5\u8981\u306a\u304f\u52d5\u7684\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3002<br \/>\u203b \u300c\u307b\u307c\u300d\u6700\u65b0\u7248\u3068\u3057\u305f\u7406\u7531\u306f\u3001\u3042\u304f\u307e\u3067\u3082\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u8907\u6570\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4e2d\u306e\u6700\u65b0\u7248\u3092Python\u30e9\u30f3\u30c1\u30e3\u30fc\u304c\u9078\u629e\u3059\u308b\u3001\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>3.2. \u9069\u5207\u306a\u30d0\u30fc\u30b8\u30e7\u30f3\u306e python.exe \u306b\u30d1\u30b9\u3092\u901a\u3059\u3002<\/h4>\n<p>&nbsp;<\/p>\n<h3>4. \u80cc\u666f<\/h3>\n<p>\u516c\u5f0f\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u306f python.exe \u3078\u306e\u30d1\u30b9\u3092\u8a2d\u5b9a\u3057\u306a\u3044\u3002\u4ee3\u308f\u308a\u306bPython\u30e9\u30f3\u30c1\u30e3\u30fc py.exe \u304c\u30d1\u30b9\u304c\u901a\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u30fb\u30d5\u30a9\u30eb\u30c0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3002\u30e9\u30f3\u30c1\u30e3\u30fc\u7d4c\u7531\u3067 python.exe \u3092\u5b9f\u884c\u3059\u308b\u4ed5\u7d44\u307f\u306b\u3088\u308a\u3001\u8907\u6570\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e python.exe \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066 py.exe \u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5207\u63db\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u62e1\u5f35\u5b50 &quot;py&quot; \u306e\u95a2\u9023\u4ed8\u3051\u3082 py.exe \u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>UNIX\u74b0\u5883\u306a\u3069\u3068\u306e\u4e92\u63db\u6027\u3092\u6c17\u306b\u3057\u306a\u3044\u306e\u3067\u3042\u308c\u3070\u3001py.exe \u7d4c\u7531\u3067python\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3067\u5341\u5206\u3067\u3042\u308b\u3002<\/p>\n<h3>4. \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d5\u30a9\u30eb\u30c0<\/h3>\n<h4>4.1. py.exe<\/h4>\n<pre>C:\\Windows<\/pre>\n<h4>4.2. python.exe<\/h4>\n<ul>\n<li>ver. 3.10 \u306e\u4f8b<\/li>\n<li>Windows\u7248\u306e\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306f 3.x\u7cfb \u3082 &quot;python.exe&quot; (\u2260python3.exe) \u3067\u3042\u308b\u3002<\/li>\n<\/ul>\n<h5>4.2.1. for all users<\/h5>\n<pre>C:\\Program Files\\Python\\Python310<\/pre>\n<h5>4.2.2. for user<\/h5>\n<pre>C:\\Users\\UserName\\AppDate\\Local\\Programs\\Python\\Python310<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. \u75c7\u72b6 \u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089Python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306b\u3082\u304b\u304b\u308f\u3089\u305a python (python3) \u304c\u5b9f\u884c\u3067\u304d\u306a\u3044\u3002 1.1. Microsoft Store\u3078\u306e\u30ea\u30f3\u30af\u304c\u958b\u304f Microsoft Store\u306ePyt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[131,52,38],"class_list":["post-5112","post","type-post","status-publish","format-standard","hentry","category-memo","tag-pip","tag-python","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/5112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=5112"}],"version-history":[{"count":33,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/5112\/revisions"}],"predecessor-version":[{"id":7450,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/5112\/revisions\/7450"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=5112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=5112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=5112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}