{"id":46040,"date":"2023-06-16T09:19:25","date_gmt":"2024-02-04T18:12:18","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/"},"modified":"2024-04-30T09:09:13","modified_gmt":"2024-04-30T01:09:13","slug":"46040-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/","title":{"rendered":""},"content":{"rendered":"<h2>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u3067\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306eJupyter\u3092\u4f7f\u3046\u306b\u306f\uff1f<\/h2>\n<h3>\u3053\u306e\u8a18\u4e8b\u306e\u76ee\u7684<\/h3>\n<p>\u7121\u6599\u3067\u5229\u7528\u53ef\u80fd\u306aJupyter\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3044\u3048\u3070Google Colaboratory\u3084Watson Studio\u3068\u3044\u3063\u305f\u3082\u306e\u304c\u30e1\u30b8\u30e3\u30fc\u3067\u3088\u304f\u77e5\u3089\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u521d\u3081\u304b\u3089\u4e00\u901a\u308a\u306e\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306a\u3069\u304c\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u3066\u304a\u308a\u3001\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3059\u308b\u3060\u3051\u3067\u7279\u306b\u4f55\u306e\u6e96\u5099\u3082\u5fc5\u8981\u306a\u304f\u3001\u624b\u9593\u3082\u304b\u304b\u3089\u305a\u3059\u3050\u306b\u59cb\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u512a\u308c\u305f\u30b5\u30fc\u30d3\u30b9\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u4ee3\u308f\u308a\u3001\u65b0\u305f\u306b\u4f7f\u3044\u305f\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8ffd\u52a0\u3057\u305f\u308a\u3001\u4f5c\u6210\u3057\u305f\u30c7\u30fc\u30bf\u3092\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u30af\u30e9\u30a6\u30c9\u306b\u4fdd\u5b58\u3057\u3066\u3082\u3001\u57fa\u672c\u7684\u306b\u306f\u6c38\u7d9a\u5316\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u305a\u3001\u30b5\u30a4\u30f3\u30a2\u30a6\u30c8\u3059\u308b\u3068\u6d88\u6ec5\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u4e0d\u4fbf\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30d9\u30fc\u30b9\u306fJupyter Notebook\u3067\u3042\u308a\u3001\u3088\u308a\u9032\u5316\u3057\u305fJupyter Lab\u306f\u4f7f\u3048\u307e\u305b\u3093\u3057\u3001Python\u4ee5\u5916\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u306e\u30ab\u30fc\u30cd\u30eb\u3082\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30b8\u30ec\u30f3\u30de\u3092\u89e3\u6d88\u3059\u308b\u305f\u3081\u306b\u3001\u6253\u958b\u7b56\u3092\u6a21\u7d22\u3057\u305f\u7d50\u679c\u3001\u3088\u308a\u81ea\u7531\u306b\u5229\u7528\u3067\u304d\u308b\u74b0\u5883\u3068\u3057\u3066Google Cloud Shell\u306b\u6ce8\u76ee\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>Cloud Shell\u3082Google\u306e\u7121\u6599\u30b5\u30fc\u30d3\u30b9\u306a\u306e\u3067\u3001PC\u306b\u3066\u3001Android\u30e6\u30fc\u30b6\u30fc\u3067\u3042\u308c\u3070\u5fc5\u305a\u3068\u8a00\u3063\u3066\u3088\u3044\u307b\u3069\u767b\u9332\u3057\u3066\u3044\u308bGoogle\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30b5\u30a4\u30f3\u30a4\u30f3\u3057\u3001\u5229\u7528\u898f\u7d04\u306b\u540c\u610f\u3059\u308b\u3060\u3051\u3067\u8ab0\u3067\u3082\u3059\u3050\u306b\u5229\u7528\u958b\u59cb\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u500b\u4eba\u7684\u306b\u63a1\u7528\u3057\u3066\u3044\u308bCloud Shell\u306b\u3088\u308bJupyter Lab\u306e\u904b\u7528\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u307e\u305a\u6700\u521d\u306b\u3084\u3063\u3066\u304a\u304d\u305f\u3044\u3053\u3068\u3002<\/h3>\n<p>\u4e0b\u8a18URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3001\u3057\u3070\u3089\u304f\u5f85\u3064\u3068\u30bf\u30fc\u30df\u30ca\u30eb\u304c\u8d77\u52d5\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u8d77\u52d5\u51fa\u6765\u305f\u3089\u3001\u4f55\u306f\u3055\u3066\u304a\u304dCloud Shell\u3092\u65e5\u672c\u8a9e\u5316\u3057\u3066\u304a\u304d\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u3002\u65e5\u672c\u8a9e\u30ed\u30b1\u30fc\u30eb\u306f\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u306e\u3067\u3001\u3084\u306f\u308a\u6c38\u7d9a\u5316\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u5e78\u3044\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u306f\u5c0f\u3055\u304f\u3001\u8d77\u52d5\u3059\u308b\u305f\u3073\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3082\u3055\u307b\u3069\u7169\u308f\u3057\u304f\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306b.bash_login\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30b3\u30de\u30f3\u30c9\u3092\u8a18\u8ff0\u3057\u3066\u304a\u3051\u3070\u3088\u3044\u306e\u3067\u3059\u304c\u3001\u3055\u3059\u304c\u306b\u8ffd\u52a0\u3067\u65b0\u898f\u306eBASH\u3092\u8d77\u52d5\u3059\u308b\u305f\u3073\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u3068\u7169\u308f\u3057\u3044\u305f\u3081\u3001\u4e00\u756a\u6700\u521d\u306bBASH\u304c\u8d77\u52d5\u3059\u308b\u3068\u304d\u3060\u3051\u306b\u884c\u308f\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f.bash_login\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>locale <span class=\"nt\">--all<\/span> | <span class=\"nb\">grep<\/span> <span class=\"nt\">--quiet<\/span> ja_JP.utf8\r\n<span class=\"k\">if<\/span> <span class=\"o\">[<\/span> <span class=\"nv\">$?<\/span> <span class=\"nt\">-ne<\/span> 0 <span class=\"o\">]<\/span><span class=\"p\">;<\/span> <span class=\"k\">then         \r\n   <\/span><span class=\"nb\">sudo <\/span>localedef <span class=\"nt\">-i<\/span> ja_JP <span class=\"nt\">-c<\/span> <span class=\"nt\">-f<\/span> UTF-8 <span class=\"nt\">-A<\/span> \/usr\/share\/locale\/locale.alias ja_JP.UTF-8 <span class=\"nt\">-v<\/span> 2&gt;\/dev\/null\r\n<span class=\"k\">fi\r\n<\/span><span class=\"nb\">export <\/span><span class=\"nv\">LANG<\/span><span class=\"o\">=<\/span>ja_JP.UTF-8\r\n<\/code><\/pre>\n<h3>pip3\u30b3\u30de\u30f3\u30c9\u3067\u30e6\u30fc\u30b6\u30fc\u30b9\u30da\u30fc\u30b9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u4eca\u56de\u306f\u500b\u4eba\u7684\u306b\u5229\u7528\u5b9f\u7e3e\u306e\u3042\u308b\u30d0\u30fc\u30b8\u30e7\u30f33.1.8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002pip\u30b3\u30de\u30f3\u30c9\u306fPython2\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u7ba1\u7406\u3059\u308b\u3082\u306e\u306a\u306e\u3067\u3001\u3053\u308c\u3067\u306f\u306a\u304fpip3\u30b3\u30de\u30f3\u30c9\u3067\u4eca\u5f8c\u3082\u6c38\u7d9a\u5316\u51fa\u6765\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081&#8211;user\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u52a0\u3057\u3001\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>pip3 <span class=\"nb\">install<\/span> <span class=\"nt\">--user<\/span> <span class=\"nv\">jupyterlab<\/span><span class=\"o\">==<\/span>3.1.8\r\n<\/code><\/pre>\n<p>node.js\u306f\u3059\u3067\u306b\u5c0e\u5165\u6e08\u307f\u306e\u72b6\u614b\u306a\u306e\u3067\u3001Python\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5272\u3068\u77ed\u6642\u9593\u3067\u5b8c\u4e86\u3057\u307e\u3059\u3002\u7d42\u308f\u3063\u305f\u3089\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3050\u306b\u3067\u3082\u8d77\u52d5\u81ea\u4f53\u306f\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>~\/.local\/bin\/jupyter lab\r\n<\/code><\/pre>\n<h3>Jupyter Lab\u306e\u521d\u56de\u8d77\u52d5\u304c\u51fa\u6765\u308b\u307e\u3067<\/h3>\n<p>\u3057\u304b\u3057\u3001\u3053\u306e\u6bb5\u968e\u3067\u306f\u307e\u3060\u5b9f\u969b\u306b\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306f\u306a\u3089\u305a\u3001\u5c11\u3057\u3070\u304b\u308a\u8ffd\u52a0\u306e\u4f5c\u696d\u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30b9\u30bf\u30fc\u30c8\u6642\u306b\u81ea\u52d5\u7684\u306b\u30d6\u30e9\u30a6\u30b6\u3092\u8d77\u52d5\u3057\u3066\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u4ed5\u69d8\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001Cloud Shell\u306b\u306fGUI\u304c\u5099\u308f\u3063\u3066\u304a\u3089\u305a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30d6\u30e9\u30a6\u30b6\u306b\u306f\u30c6\u30ad\u30b9\u30c8\u30d6\u30e9\u30a6\u30b6\u306eLynx\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3061\u3089\u3067\u8868\u793a\u3057\u3066\u3082JavaScript\u304c\u52d5\u4f5c\u3057\u306a\u3044\u305f\u3081\u3001\u5f53\u7136Jupyter Lab\u3082\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<br \/>\n\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u3001\u8a2d\u5b9a\u306b\u3088\u308a\u30d6\u30e9\u30a6\u30b6\u306e\u81ea\u52d5\u8d77\u52d5\u3092\u7121\u52b9\u5316\u3057\u3001\u30dd\u30fc\u30c8\u3092\u30ea\u30c3\u30b9\u30f3\u3057\u3066\u5f85\u3061\u53d7\u3051\u3059\u308b\u3060\u3051\u306b\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306b.jupyter\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u914d\u4e0b\u306bjupyter_lab_config.py\u3068\u3044\u3046\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u4e0b\u8a18\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">LabServerApp<\/span><span class=\"p\">.<\/span><span class=\"n\">open_browser<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">False<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u518d\u5ea6Jupyter Lab\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002\u8d77\u52d5\u3057\u305f\u3089CloudShell\u306e\u53f3\u4e0a\u306e\u30a6\u30a7\u30d6\u3067\u30d7\u30ec\u30d3\u30e5\u30fc\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30e1\u30cb\u30e5\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/27-0.png\" alt=\"image.png\" \/><\/div>\n<p>\u30dd\u30fc\u30c8\u756a\u53f7\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u30678080\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u30018888\u306b\u5909\u66f4\u3057\u3066\u304b\u3089\u30d7\u30ec\u30d3\u30e5\u30fc\u3057\u307e\u3059\u3002<\/p>\n<h3>Jupyter Lab\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u3088\u308b\u554f\u984c\u3092\u56de\u907f\u3059\u308b\u3002<\/h3>\n<p>\u3059\u308b\u3068\u30d6\u30e9\u30a6\u30b6\u306e\u65b0\u3057\u3044\u30bf\u30d6\u3067Jupyter Lab\u306e\u521d\u56de\u8d77\u52d5\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3001\u30c8\u30fc\u30af\u30f3\u306e\u5165\u529b\u3092\u4fc3\u3055\u308c\u307e\u3059\u3002\u51fa\u529b\u30ed\u30b0\u306b\u30c8\u30fc\u30af\u30f3\u306f\u63d0\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u3092\u30b3\u30d4\u30fc\u3057\u3066\u8cbc\u308a\u4ed8\u3051\u3066\u3082\u8a8d\u8a3c\u306b\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/31-0.png\" alt=\"image.png\" \/><\/div>\n<p>\u539f\u56e0\u306f\u304a\u305d\u3089\u304f\u3001CloudShell\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306fBorg\u3084Ingress\u304c\u4ecb\u5728\u3057\u3066\u3044\u308b\u8907\u96d1\u306a\u69cb\u6210\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3060\u3068\u601d\u308f\u308c\u307e\u3059\u3002<br \/>\n\u305d\u306e\u7d50\u679cCookie\u3092\u60aa\u7528\u3057\u305fCross-Site Request Forgeries(CSRF\u307e\u305f\u306fXSRF)\u653b\u6483\u306b\u3088\u308b\u4e0d\u6b63\u30a2\u30af\u30bb\u30b9\u3068\u898b\u505a\u3055\u308c\u3066\u3057\u307e\u3044\u3001\u8a8d\u8a3c\u3092\u62d2\u5426\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u554f\u984c\u3092\u56de\u907f\u3059\u308b\u306b\u306f\u3001\u524d\u8ff0\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u4e0b\u8a18\u306e\u8a2d\u5b9a\u3092\u8ffd\u8a18\u3057\u3066XSRF\u306e\u30c1\u30a7\u30c3\u30af\u6a5f\u80fd\u3092\u7121\u52b9\u5316\u3059\u308b\u5fc5\u8981\u304c\u6709\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">ServerApp<\/span><span class=\"p\">.<\/span><span class=\"n\">disable_check_xsrf<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">True<\/span>\r\n<\/code><\/pre>\n<p>\u305f\u3060\u3057\u3001\u30c8\u30fc\u30af\u30f3\u3067\u306e\u8a8d\u8a3c\u306f\u3069\u3046\u3082\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3088\u3046\u3067\u3057\u305f\u306e\u3067\u3001\u4e8b\u524d\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u3053\u3068\u306b\u3088\u308a\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u306e\u307f\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>~\/.local\/bin\/jupyter lab password\r\n<\/code><\/pre>\n<p>\u307e\u305f\u306f\u3001\u305d\u3082\u305d\u3082\u30d1\u30d6\u30ea\u30c3\u30af\u306a\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u30a2\u30d7\u30ea\u3067\u306f\u7121\u3044\u306e\u3067\u3001\u8a8d\u8a3c\u306e\u6a5f\u80fd\u81ea\u4f53\u3092\u7121\u52b9\u5316\u3057\u3066\u3057\u307e\u3063\u305f\u307b\u3046\u304c\u3001\u7169\u308f\u3057\u3055\u304c\u306a\u304f\u3066\u3088\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u4e0b\u8a18\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308c\u3070\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">ServerApp<\/span><span class=\"p\">.<\/span><span class=\"n\">token<\/span> <span class=\"o\">=<\/span> <span class=\"sh\">''<\/span>\r\n<span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">ServerApp<\/span><span class=\"p\">.<\/span><span class=\"n\">password<\/span> <span class=\"o\">=<\/span> <span class=\"sh\">''<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3082\u3046\u4e00\u5ea6Jupyter Lab\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u51fa\u529b\u30ed\u30b0\u306b<\/p>\n<blockquote><p>All authentication is disabled. Anyone who can connect to this server will be able to run code.<\/p><\/blockquote>\n<p>\u3068\u3044\u3063\u305f\u8b66\u544a\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u3082\u3068\u3082\u3068\u9589\u3056\u3055\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306a\u306e\u3067\u5916\u90e8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u306f\u4e0d\u53ef\u80fd\u3067\u3042\u308b\u305f\u3081\u3001\u7279\u306b\u554f\u984c\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u3053\u308c\u3067\u30a6\u30a7\u30d6\u3067\u30d7\u30ec\u30d3\u30e5\u30fc\u3059\u308b\u3068\u4eca\u5ea6\u306f\u8a8d\u8a3c\u30da\u30fc\u30b8\u306f\u51fa\u73fe\u305b\u305a\u3001Jupyter Lab\u306eLauncher\u30bf\u30d6\u304c\u8868\u793a\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3053\u306e\u307e\u307e\u3060\u3068\u3001\u307e\u3060\u30b3\u30f3\u30bd\u30fc\u30eb\u3084\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u304c\u30a8\u30e9\u30fc\u3068\u306a\u3063\u3066\u8d77\u52d5\u3067\u304d\u307e\u305b\u3093\u3002\u524d\u8ff0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u74b0\u5883\u306e\u554f\u984c\u3067\u3001Jupyer Lab\u5074\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u3088\u308aWebSocket\u304c\u30d6\u30ed\u30c3\u30af\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u3055\u3089\u306bjupyter_lab_config.py\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u4e0b\u8a18\u306e\u9805\u76ee\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">ServerApp<\/span><span class=\"p\">.<\/span><span class=\"n\">allow_origin<\/span> <span class=\"o\">=<\/span> <span class=\"sh\">'<\/span><span class=\"s\">*<\/span><span class=\"sh\">'<\/span>\r\n<\/code><\/pre>\n<p>\u3064\u3044\u3067\u3067\u3059\u304c\u3001Jupyter Lab\u306e\u30a8\u30c7\u30a3\u30bf\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u3092\u7de8\u96c6\u3059\u308b\u306e\u3067\u3042\u308c\u3070\u3001<\/p>\n<pre class=\"post-pre\"><code><span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">ContentsManager<\/span><span class=\"p\">.<\/span><span class=\"n\">allow_hidden<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">True<\/span>\r\n<\/code><\/pre>\n<p>\u3082\u8ffd\u8a18\u3057\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u30d6\u30e9\u30a6\u30b6\u3067\u96a0\u3057\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\uff08\u3082\u3063\u3068\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001\u30e1\u30cb\u30e5\u30fc\u3067\u5207\u308a\u66ff\u3048\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff09<\/p>\n<h3>\u300a\u9591\u8a71\u4f11\u984c\u300b\u3000\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066<\/h3>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30ebjupyter_lab_config.py\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3001\u305d\u308c\u3092\u4fee\u6b63\u3057\u3066\u8a2d\u5b9a\u3092\u884c\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>~\/.local\/bin\/jupyter lab <span class=\"nt\">--generate-config<\/span>\r\nWriting default config to: \/home\/username\/.jupyter\/jupyter_lab_config.py\r\n<\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u62e1\u5f35\u5b50\u304b\u3089\u3082\u5206\u304b\u308b\u3088\u3046\u306b\u3001Python\u306e\u30b3\u30fc\u30c9\u305d\u306e\u3082\u306e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001Python\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u3001\u8a2d\u5b9a\u5024\u3092\u8a18\u8ff0\u3057\u3084\u3059\u3044\u3088\u3046\u306b\u5de5\u592b\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u79c1\u81ea\u8eab\u306f<\/p>\n<pre class=\"post-pre\"><code><span class=\"kn\">from<\/span> <span class=\"n\">os<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">environ<\/span><span class=\"p\">,<\/span> <span class=\"n\">getenv<\/span><span class=\"p\">,<\/span> <span class=\"n\">putenv<\/span><span class=\"p\">,<\/span> <span class=\"n\">path<\/span>\r\n<span class=\"kn\">import<\/span> <span class=\"n\">sys<\/span>\r\n<\/code><\/pre>\n<p>\u3068\u3044\u3063\u305f\u30b3\u30fc\u30c9\u3092\u30d5\u30a1\u30a4\u30eb\u306e\u5192\u982d\u306b\u633f\u5165\u3057\u3066\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305fLinux\u3068Windows\u3068\u3044\u3063\u305f\u3088\u3046\u306b\u7570\u306a\u308b\u74b0\u5883\u3067Jupyter Lab\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u305d\u308c\u305e\u308c\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u3044\u5206\u3051\u308b\u306e\u306f\u3001\u601d\u3044\u306e\u307b\u304b\u7169\u308f\u3057\u3044\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u74b0\u5883\u306b\u3088\u308a\u5909\u66f4\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u8a2d\u5b9a\u5024\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30b9\u3084\u3001\u53c2\u7167\u3059\u308b\u74b0\u5883\u5909\u6570\u3050\u3089\u3044\u3067\u3001\u305d\u306e\u4ed6\u306f\u540c\u3058\u8a2d\u5b9a\u3067\u69cb\u308f\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u305d\u3053\u3067\u74b0\u5883\u306b\u3088\u308a\u8a2d\u5b9a\u5024\u304c\u7570\u306a\u308b\u9805\u76ee\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u6761\u4ef6\u5206\u5c90\u306b\u3088\u308b\u8a18\u8ff0\u3067\u3088\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"k\">if<\/span> <span class=\"n\">sys<\/span><span class=\"p\">.<\/span><span class=\"n\">platform<\/span> <span class=\"o\">==<\/span> <span class=\"sh\">'<\/span><span class=\"s\">win32<\/span><span class=\"sh\">'<\/span><span class=\"p\">:<\/span>\r\n    <span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">ServerApp<\/span><span class=\"p\">.<\/span><span class=\"n\">terminado_settings<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span><span class=\"sh\">'<\/span><span class=\"s\">shell_command<\/span><span class=\"sh\">'<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span><span class=\"sa\">r<\/span><span class=\"sh\">'<\/span><span class=\"s\">C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe<\/span><span class=\"sh\">'<\/span><span class=\"p\">]}<\/span>\r\n<span class=\"k\">elif<\/span> <span class=\"n\">sys<\/span><span class=\"p\">.<\/span><span class=\"n\">platform<\/span> <span class=\"o\">==<\/span> <span class=\"sh\">'<\/span><span class=\"s\">linux<\/span><span class=\"sh\">'<\/span><span class=\"p\">:<\/span>\r\n    <span class=\"n\">c<\/span><span class=\"p\">.<\/span><span class=\"n\">ServerApp<\/span><span class=\"p\">.<\/span><span class=\"n\">terminado_settings<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span><span class=\"sh\">'<\/span><span class=\"s\">shell_command<\/span><span class=\"sh\">'<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span><span class=\"sh\">'<\/span><span class=\"s\">\/usr\/bin\/env<\/span><span class=\"sh\">'<\/span><span class=\"p\">,<\/span> <span class=\"sh\">'<\/span><span class=\"s\">TERM=xterm-256color<\/span><span class=\"sh\">'<\/span><span class=\"p\">,<\/span> <span class=\"sh\">'<\/span><span class=\"s\">\/bin\/bash<\/span><span class=\"sh\">'<\/span><span class=\"p\">,<\/span> <span class=\"sh\">'<\/span><span class=\"s\">--login<\/span><span class=\"sh\">'<\/span> <span class=\"p\">]}<\/span>\r\n<\/code><\/pre>\n<p>\u305d\u306e\u4ed6\u306b\u3082\u5de5\u592b\u6b21\u7b2c\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u7ba1\u7406\u3092\u7701\u529b\u5316\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>Jupyter Lab\u306e\u4e16\u754c\u3078\u3088\u3046\u3053\u305d<\/h3>\n<p>\u4ee5\u4e0a\u306e\u5bfe\u7b56\u3092\u8b1b\u3058\u3066\u304a\u3051\u3070\u3001\u7e26\u6a2a\u7121\u5c3d\u306bjupyter Lab\u3092\u4f7f\u3044\u3053\u306a\u305b\u308b\u6e96\u5099\u306f\u51fa\u6765\u4e0a\u304c\u308a\u3067\u3059\u3002\u305f\u3060\u3057\u4e00\u756a\u5927\u304d\u306a\u30cd\u30c3\u30af\u3068\u306a\u308b\u8981\u56e0\u3068\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u7531\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3067\u304d\u308b\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u304c\u304b\u306a\u308a\u9650\u3089\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3073\u306b\u4fdd\u5b58\u3055\u308c\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u30c7\u30fc\u30bf\u306b\u3088\u308a\u6d88\u8cbb\u3055\u308c\u308b\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u306e\u5f71\u97ff\u306f\u6df1\u523b\u3067\u3059\u3002\u3053\u307e\u3081\u306b\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306e.cache\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u6d88\u8cbb\u30b5\u30a4\u30ba\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u983b\u7e41\u306b\u524a\u9664\u3057\u3066\u7a7a\u304d\u5bb9\u91cf\u3092\u78ba\u4fdd\u3059\u308b\u5fc5\u8981\u304c\u6709\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u4e00\u6bb5\u843d\u3064\u3044\u305f\u3068\u3053\u308d\u3067\u3001\u771f\u3063\u5148\u306b\u5165\u308c\u3066\u304a\u304d\u305f\u3044\u62e1\u5f35\u6a5f\u80fd\u3068\u3057\u3066jupyterlab-git\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>pip3 <span class=\"nb\">install<\/span> <span class=\"nt\">--user<\/span> jupyterlab-git\r\n<\/code><\/pre>\n<p>\u5c0e\u5165\u5f8c\u306f\u3001\u5de6\u306e\u30b5\u30a4\u30c9\u30d0\u30fc\u306bGit\u306e\u30a2\u30a4\u30b3\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/65-0.png\" alt=\"image.png\" \/><\/div>\n<p>Jupyter Lab\u306f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u306b\u3088\u308a\u69d8\u3005\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u53ef\u80fd\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u5230\u5e95\u3053\u3053\u3067\u306f\u7d39\u4ecb\u3057\u304d\u308c\u307e\u305b\u3093\u304c\u3001\u3044\u305a\u308c\u305d\u306e\u3046\u3061\u306bPython\u4ee5\u5916\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u306e\u30ab\u30fc\u30cd\u30eb\u306e\u5c0e\u5165\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u6295\u7a3f\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5dee\u3057\u5f53\u305f\u308a\u3001Python2\u306e\u30ab\u30fc\u30cd\u30eb\u306b\u3064\u3044\u3066\u306e\u6ce8\u610f\u70b9\u3092\u63b2\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\u3002CloudShell\u306b\u306fPython2\u304c\u3042\u3089\u304b\u3058\u3081\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3001\u6e96\u5099\u3092\u7d42\u3048\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u307e\u307e\u4f55\u3082\u4fee\u6b63\u305b\u305a\u306bPython2\u306e\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u3084\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u8d77\u52d5\u3057\u3088\u3046\u3068\u3059\u308b\u3068Python3\u306e\u30ab\u30fc\u30cd\u30eb\u304c\u8d77\u52d5\u3059\u308b\u306f\u305a\u3067\u3059\u306e\u3067\u3001\u6b63\u3057\u304fPython2\u3092\u8d77\u52d5\u3059\u308b\u306b\u306f\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e.local\/share\/jupyter\/kernels\/python2\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u5099\u3055\u308c\u3066\u3044\u308bkernel.json\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"p\">{<\/span>\r\n <span class=\"nl\">\"display_name\"<\/span><span class=\"p\">:<\/span> <span class=\"s2\">\"Python 2\"<\/span><span class=\"p\">,<\/span> \r\n <span class=\"nl\">\"language\"<\/span><span class=\"p\">:<\/span> <span class=\"s2\">\"python\"<\/span><span class=\"p\">,<\/span> \r\n <span class=\"nl\">\"argv\"<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\r\n  <span class=\"s2\">\"python\"<\/span><span class=\"p\">,<\/span> \r\n  <span class=\"s2\">\"-m\"<\/span><span class=\"p\">,<\/span> \r\n  <span class=\"s2\">\"ipykernel_launcher\"<\/span><span class=\"p\">,<\/span> \r\n  <span class=\"s2\">\"-f\"<\/span><span class=\"p\">,<\/span> \r\n  <span class=\"s2\">\"{connection_file}\"<\/span>\r\n <span class=\"p\">]<\/span>\r\n<span class=\"p\">}<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u306eJSON\u30c7\u30fc\u30bf\u306eargv\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u304cpython\u3068\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u539f\u56e0\u3067\u3059\u3002Jupyter Lab\u81ea\u4f53\u304cPython3\u3067\u52d5\u4f5c\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u7121\u3057\u3067Python\u3092\u8d77\u52d5\u3059\u308b\u3068Python3\u304c\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30b3\u30de\u30f3\u30c9\u540d\u3092python2\u3068\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u554f\u984c\u3092\u56de\u907f\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Jupyter\u5074\u306f\u3053\u3053\u307e\u3067\u3067\u3044\u3044\u306e\u3067\u3059\u304c\u3001Python2\u5074\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u554f\u984c\u3067\u8d77\u52d5\u6642\u306b\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u5b9f\u969b\u306bIPython2\u3092\u8d77\u52d5\u3059\u308b\u3068\u30a8\u30e9\u30fc\u3067\u7d42\u4e86\u3057\u3066\u3057\u307e\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>ipython2\r\nTraceback <span class=\"o\">(<\/span>most recent call last<span class=\"o\">)<\/span>:\r\n  File <span class=\"s2\">\"\/usr\/local\/bin\/ipython2\"<\/span>, line 6, <span class=\"k\">in<\/span> &lt;module&gt;\r\n    from IPython import start_ipython\r\n  File <span class=\"s2\">\"\/usr\/local\/lib\/python2.7\/dist-packages\/IPython\/__init__.py\"<\/span>, line 49, <span class=\"k\">in<\/span> &lt;module&gt;\r\n    from .terminal.embed import embed\r\n  File <span class=\"s2\">\"\/usr\/local\/lib\/python2.7\/dist-packages\/IPython\/terminal\/embed.py\"<\/span>, line 17, <span class=\"k\">in<\/span> &lt;module&gt;\r\n    from IPython.terminal.interactiveshell import TerminalInteractiveShell\r\n  File <span class=\"s2\">\"\/usr\/local\/lib\/python2.7\/dist-packages\/IPython\/terminal\/interactiveshell.py\"<\/span>, line 19, <span class=\"k\">in<\/span> &lt;module&gt;\r\n    from prompt_toolkit.shortcuts import create_prompt_application, create_eventloop, create_prompt_layout, create_output\r\nImportError: cannot import name create_prompt_application\r\n<\/code><\/pre>\n<p>\u3053\u306e\u554f\u984c\u306b\u95a2\u3057\u3066\u306f\u4f9d\u5b58\u3057\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>pip2 <span class=\"nb\">install<\/span> <span class=\"nt\">--user<\/span> ipykernel\r\n<\/code><\/pre>\n<p>\u3053\u306e\u969bkernel.json\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u3001\u518d\u5ea6\u4fee\u6b63\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3067IPython2\u304c\u4f7f\u7528\u53ef\u80fd\u3068\u306a\u308a\u3001\u3084\u3063\u3068Python2\u30ab\u30fc\u30cd\u30eb\u304c\u8d77\u52d5\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/76-0.png\" alt=\"image.png\" \/><\/div>\n<p>\u305f\u3060\u3057pyhthon2\u3092\u8d77\u52d5\u3059\u308b\u305f\u3073\u306b\u30b5\u30dd\u30fc\u30c8\u7d42\u4e86\u306b\u3088\u308b\u8b66\u544a\u304c\u51fa\u3066\u3001\u304b\u306a\u308a\u5f85\u305f\u3055\u308c\u308b\u3053\u3068\u304c\u6c17\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">mkdir<\/span> <span class=\"nt\">-pv<\/span> ~\/.cloudshell\r\n\r\n<span class=\"nb\">touch<\/span> ~\/.cloudshell\/no-python-warning ~\/.cloudshell\/no-pip-warning\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3089\u306f.bash_login\u306b\u8ffd\u8a18\u3057\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3>Jupyter Lab\u306e\u5c0e\u5165\u306b\u3088\u308b\u30e1\u30ea\u30c3\u30c8<\/h3>\n<p>Jupyter Lab\u3067\u306f\u30ab\u30fc\u30a8\u30eb\u3084\u30a8\u30c7\u30a3\u30bf\u306e\u6a5f\u80fd\u4ee5\u5916\u306b\u3082\u3001\u512a\u308c\u305f\u30bf\u30fc\u30df\u30ca\u30eb\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3082\u5229\u70b9\u3068\u3057\u3066\u6319\u3052\u3089\u308c\u307e\u3059\u3002<br \/>\nCloudShell\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u306f\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u3042\u307e\u308a\u826f\u304f\u306a\u304f\u3001\u8868\u793a\u80fd\u529b\u3082\u5341\u5206\u3067\u306f\u306a\u3044\u3068\u611f\u3058\u3089\u308c\u308b\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f\u3000\u307e\u305f\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306b\u3088\u308b\u30d0\u30c3\u30af\u30b9\u30af\u30ed\u30fc\u30eb\u3082\u4f7f\u3048\u307e\u305b\u3093\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u3088\u304f\u5229\u7528\u3059\u308bMidnight Commander\u306e\u8868\u793a\u3082\u5d29\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3057\u3001tmux\u306e\u30d0\u30c3\u30af\u30b9\u30af\u30ed\u30fc\u30eb\u306f\u78ba\u304b\u306b\u4fbf\u5229\u3067\u3059\u304c\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u4f7f\u3044\u305f\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>Jupyter Lab\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u306f\u3053\u306e\u554f\u984c\u3082\u304b\u306a\u308a\u6539\u5584\u3055\u308c\u307e\u3059\u3002<br \/>\nJupyter Lab\u3067\u74b0\u5883\u5909\u6570TERM\u3092xterm-256color\u3068\u3057\u3001Midnight Commander\u3092256\u8272\u306e\u30c6\u30fc\u30de\u306b\u5207\u308a\u66ff\u3048\u3066\u8868\u793a\u3057\u305f\u753b\u9762\u3092\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u63b2\u8f09\u3057\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/84-0.png\" alt=\"image.png\" \/><\/div>\n<p>\u86c7\u8db3\u3067\u3059\u304c\u3001tmux\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u308b\u5834\u5408\u3001Jupyter Lab\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089CloudShell\u306eShell\u306b\u63a5\u7d9a\u3057\u3001\u5171\u6709\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>tmux attach <span class=\"nt\">-t<\/span>:cloudshell\r\n<\/code><\/pre>\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u3001tmux\u306e\u30db\u30c3\u30c8\u30ad\u30fc\u3067\u3042\u308bctrl+b\u304cJupyter Lab\u3067\u306f\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u958b\u9589\u306b\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u304a\u308a\u7af6\u5408\u3059\u308b\u305f\u3081\u3001\u30db\u30c3\u30c8\u30ad\u30fc\u3092\u5225\u306e\u30ad\u30fc\u306b\u5909\u66f4\u3057\u305f\u307b\u3046\u304c\u826f\u3044\u3067\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/88-0.png\" alt=\"image.png\" \/><\/div>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/89-0.png\" alt=\"image.png\" \/><\/div>\n<p>\u305d\u308c\u306a\u308a\u306b\u9762\u767d\u3044\u304b\u3068\u306f\u601d\u3044\u307e\u3059\u304c\u3001\u4f55\u304b\u3044\u3044\u3053\u3068\u304c\u3042\u308b\u306e\u304b\u3068\u8a0a\u304b\u308c\u308b\u3068\u3001\u4f55\u3068\u3082\u8a00\u3044\u3088\u3046\u304c\u306a\u3044\u3068\u3053\u308d\u3067\u3059\u3002\u89aa\u306eShell\u304b\u3089\u4ed6\u306e\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u3092\u8d77\u52d5\u3067\u304d\u308b\u3068\u3044\u3046\u3053\u3068\u3050\u3089\u3044\u3067\u3057\u3087\u3046\u304b\uff1f\u3000\u30bf\u30d6\u3092\u5207\u308a\u66ff\u3048\u308c\u3070\u3044\u3044\u3060\u3051\u306e\u3053\u3068\u3067\u3059\u304c\u3001Jupyter Lab\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u306e\u307b\u3046\u304c\u9ad8\u6027\u80fd\u3067\u3059\u304b\u3089\u3002<\/p>\n<p>\u3061\u306a\u307f\u306bnteract\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u307e\u3057\u305f\u304c\u3001\u4eca\u4e00\u3064\u5feb\u9069\u306a\u52d5\u4f5c\u3068\u306f\u8a00\u3048\u306a\u3044\u3088\u3046\u306a\u72b6\u614b\u3067\u3057\u305f\u3002<\/p>\n<p>\u6700\u5f8c\u307e\u3067\u8aad\u3093\u3067\u304f\u3060\u3055\u3063\u305f\u65b9\u306b\u306f\u3001\u5fc3\u3088\u308a\u611f\u8b1d\u3044\u305f\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u6a5f\u306bJupyter Lab\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u3066\u3044\u305f\u3060\u3051\u305f\u3089\u5e78\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u3067\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306eJupyter\u3092\u4f7f\u3046\u306b\u306f\uff1f \u3053\u306e\u8a18\u4e8b\u306e\u76ee\u7684 \u7121\u6599\u3067\u5229\u7528\u53ef\u80fd\u306aJupyter\u30a2 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-46040","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>- Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:description\" content=\"\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u3067\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306eJupyter\u3092\u4f7f\u3046\u306b\u306f\uff1f \u3053\u306e\u8a18\u4e8b\u306e\u76ee\u7684 \u7121\u6599\u3067\u5229\u7528\u53ef\u80fd\u306aJupyter\u30a2 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-04T18:12:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T01:09:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/27-0.png\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/\",\"name\":\"- Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2024-02-04T18:12:18+00:00\",\"dateModified\":\"2024-04-30T01:09:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"- Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/","og_locale":"zh_CN","og_type":"article","og_description":"\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u3067\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306eJupyter\u3092\u4f7f\u3046\u306b\u306f\uff1f \u3053\u306e\u8a18\u4e8b\u306e\u76ee\u7684 \u7121\u6599\u3067\u5229\u7528\u53ef\u80fd\u306aJupyter\u30a2 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-02-04T18:12:18+00:00","article_modified_time":"2024-04-30T01:09:13+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d625837434c4406cffadd\/27-0.png"}],"author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/","name":"- Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2024-02-04T18:12:18+00:00","dateModified":"2024-04-30T01:09:13+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46040-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=46040"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46040\/revisions"}],"predecessor-version":[{"id":90997,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46040\/revisions\/90997"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=46040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=46040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=46040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}