{"id":2236,"date":"2020-07-14T15:42:40","date_gmt":"2020-07-14T06:42:40","guid":{"rendered":"https:\/\/www.kdel.org\/wp\/?p=2236"},"modified":"2020-10-02T16:48:38","modified_gmt":"2020-10-02T07:48:38","slug":"macos%e3%81%a7%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%83%a1%e3%83%a2","status":"publish","type":"post","link":"https:\/\/www.kdel.org\/wp\/?p=2236","title":{"rendered":"MacOS\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2"},"content":{"rendered":"<p>Mac OS 10.15.5 (Catalina) \u3067\u306e\u52d5\u4f5c\u78ba\u8a8d\u3067\u3059\uff0e<br \/>\n\u305d\u308c\u305e\u308c\u306e\u4f5c\u696d\u3092\u52d5\u753b\u3067\u3082\u7528\u610f\u3057\u307e\u3057\u305f\u306e\u3067\uff0c\u305d\u3061\u3089\u3082\u4f75\u7528\u3057\u3066\u78ba\u8a8d\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044\uff0e<\/p>\n<ul>\n<li><a href=\"https:\/\/youtu.be\/NG3wz_B0m54\">\u25a0\u52d5\u753b\u25a0Terminal\u306e\u8a2d\u5b9a\u5909\u66f4<\/a><\/li>\n<\/ul>\n<p>\u307e\u305a\uff0c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u76f4\u5f8c\u306e\u307e\u3063\u3055\u3089\u306a\u72b6\u614b\u3067\u306f\uff0cpython2.7 (2.7.16 default, Apr 17 2020, 18:29:03) \u306e\u307f\u304c\u5165\u3063\u3066\u3044\u3066\uff0cpython3\u7cfb\u5217\u306f\u4f7f\u3048\u307e\u305b\u3093\uff0e<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ryukoku@virtualMac ~ % python\r\n\r\nWARNING: Python 2.7 is not recommended. \r\nThis version is included in macOS for compatibility with legacy software. \r\nFuture versions of macOS will not include Python 2.7. \r\nInstead, it is recommended that you transition to using 'python3' from within Terminal.\r\n\r\nPython 2.7.16 (default, Apr 17 2020, 18:29:03) \r\n&#x5B;GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin\r\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\r\n&gt;&gt;&gt;\r\n<\/pre>\n<p>\u305d\u3053\u3067\uff0c\u30bf\u30fc\u30df\u30ca\u30eb\u3067python3 \u3068\u5165\u308c\u3066\u307f\u308b\u3068\uff0c\u300cXcode\uff08\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30fb\u30c7\u30d9\u30ed\u30c3\u30d1\u30c4\u30fc\u30eb\uff09\u300d\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u6c42\u3081\u3089\u308c\u307e\u3059\u306e\u3067\u300c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u3093\u3067\u307f\u307e\u3059\uff0e<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ryukoku@virtualMac ~ % python3\r\nxcode-select: note: no developer tools were found at '\/Applications\/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.<\/pre>\n<p>\u3053\u308c\u3067\uff0cpython 3.7.3\u304c\u5165\u308a\u307e\u3059\uff0e<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ryukoku@virtualMac ~ % python3\r\nPython 3.7.3 (default, Apr 24 2020, 18:51:23) \r\n&#x5B;Clang 11.0.3 (clang-1103.0.32.62)] on darwin\r\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\r\n&gt;&gt;&gt; <\/pre>\n<p>Tk \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304cpython3.8 \u7528\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\uff0cpython3.7 \u306f\u5b9f\u306f\u4e0d\u8981\u3067\u3059\uff0e<br \/>\n\u4ee5\u4e0b\u3067python3.8\u3092\u660e\u793a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\uff0cpython3.7\u304c\u306a\u304f\u306a\u308a\uff0cpython3.8\u306b\u306a\u308a\u307e\u3059\uff0e<br \/>\n\u3082\u3057\uff0cpython3.7 \u304c\u6b8b\u3063\u3066\u3044\u308b\u5834\u5408\u306f\uff0cpython3 \u30673.7\u304c\u8d77\u52d5\u3057\u307e\u3059\u306e\u3067\uff0c3.8\u3092\u4f7f\u3046\u306b\u306fpython3.8\u3068\u5165\u529b\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<ul>\n<li><a href=\"https:\/\/youtu.be\/2BTRmiblqIU\">\u25a0\u52d5\u753b\u25a0python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<\/ul>\n<p>\u3064\u3044\u3067\u306b\uff0cpip \u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo pip3 install --upgrade pip<\/pre>\n<p>python3.7 \u3060\u3068\uff0c\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u306e\u3067\uff0cpython3.8 \u3092\u5165\u308c\u308b\uff0e<br \/>\n\u305d\u306e\u524d\u306bbrew\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff0e<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\/bin\/bash -c &quot;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install.sh)&quot;\r\nbrew install pyenv\r\nbrew install python@3.8\r\n# \u3053\u3053\u3067\u4e00\u56de\u30d6\u30e9\u30a6\u30b6\u3092\u8d77\u52d5\u3057\u76f4\u3059\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\uff0e\r\nzsh\r\npip3 install -U pylint\r\npip3 install pillow\r\n<\/pre>\n<p>\u3042\u3068\uff0ctkinter \u304cMac\u6a19\u6e96\uff083.8\uff09\u3060\u3068png \u304c\u8868\u793a\u3067\u304d\u306a\u3044\u3068\u304b\u306a\u3093\u3068\u304b\uff0e<br \/>\n=> \u3053\u306e\u524d\u306f\u7121\u7406\u3060\u3063\u305f\u3051\u3069\uff0c\u4eca\u306f\u3046\u307e\u304f\u3044\u3051\u3066\u3044\u308b\u2026\uff0e<\/p>\n<ul>\n<li><a href=\"https:\/\/youtu.be\/PJ17tl3eD7Y\">\u25a0\u52d5\u753b\u25a0brew\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/youtu.be\/Wlql4cdgAQw\">\u25a0\u52d5\u753b\u25a0\u3053\u306e\u307e\u307e\u3060\u3068png\u8868\u793a\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059<\/a><\/li>\n<\/ul>\n<p>\u3082\u3057\uff0c\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u5834\u5408\u306f<a href=\"https:\/\/teratail.com\/questions\/85640?link=qa_related_pc_sidebar\">Python\u306eCanvas\u306b\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u306a\u3044<\/a>\u3092\u53c2\u8003\u306b\uff0cPIL\u3078\u306e\u66f8\u304d\u63db\u3048\u3092\u3057\u307e\u3059\uff0e<br \/>\n\u52a0\u3048\u3066\uff0c<a href=\"https:\/\/teratail.com\/questions\/85202\">_tkinter.TclError: couldn&#8217;t recognize data in image file \\&#8221;.\/chap3-back.png\\&#8221;<\/a>\u3082\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\uff0e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# import \u90e8\u5206\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\r\nfrom PIL import Image, ImageTk\r\n\r\n#\r\n# ...\r\n#\r\n\r\n# \u753b\u50cf\u306e\u8aad\u307f\u8fbc\u307f\u90e8\u5206\u3092tkinter\u304b\u3089ImageTk\u306b\u7f6e\u304d\u63db\u3048\u3066\uff0cfile\u306e\u5f15\u6570\u3067\u306f\u306a\u304fImage.open\u306b\u3057\u3066convert(&quot;RGB&quot;)\u3092\u7d4c\u7531\u3059\u308b\uff0e\r\n# img = tkinter.PhotoImage(file=&quot;chap3-back.png&quot;)\r\nimg = ImageTk.PhotoImage(Image.open(&quot;chap3-back.png&quot;).convert(&quot;RGB&quot;))\r\n<\/pre>\n<p>\u3068\u308a\u3042\u3048\u305a\uff0c\u4e0a\u8a18\u3067chap3.py \uff08Mac\u7528\u306b\u4fee\u6b63\u6e08\u307f\uff09\u304c\u52d5\u4f5c\u3057\u307e\u3057\u305f\uff0e<\/p>\n<ul>\n<li><a href=\"https:\/\/youtu.be\/Khci-j_MawY\">\u25a0\u52d5\u753b\u25a0png\u8868\u793a\u7528\u306e\u4fee\u6b63<\/a><\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<ul>\u95a2\u9023\u3059\u308b\u30e1\u30e2<\/p>\n<li><a href=\"https:\/\/www.kdel.org\/wp\/?p=2257\">Mac\u3067brew\u3057\u3066\u3044\u308b\u3068\u304d\u306e\u30e1\u30e2<\/a><\/li>\n<li><a href=\"https:\/\/www.kdel.org\/wp\/?p=2262\">Mac\u306bJupyter Notebook<\/a><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Mac OS 10.15.5 (Catalina) \u3067\u306e\u52d5\u4f5c\u78ba\u8a8d\u3067\u3059\uff0e \u305d\u308c\u305e\u308c &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.kdel.org\/wp\/?p=2236\"> <span class=\"screen-reader-text\">MacOS\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2<\/span> \u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[23,22],"tags":[],"class_list":["post-2236","post","type-post","status-publish","format-standard","hentry","category-23","category-22"],"_links":{"self":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2236"}],"version-history":[{"count":20,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2236\/revisions"}],"predecessor-version":[{"id":2494,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2236\/revisions\/2494"}],"wp:attachment":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}