{"id":420,"date":"2024-12-09T11:15:40","date_gmt":"2024-12-09T03:15:40","guid":{"rendered":"https:\/\/telaker.cn\/?p=420"},"modified":"2024-12-09T11:38:48","modified_gmt":"2024-12-09T03:38:48","slug":"jupyterlab_01","status":"publish","type":"post","link":"https:\/\/telaker.cn\/index.php\/2024\/12\/09\/jupyterlab_01\/","title":{"rendered":"JupyterLab\u914d\u7f6e\u5916\u7f51\u8bbf\u95ee"},"content":{"rendered":"\n<p>\u914d\u7f6eJupyterLab\u4ee5\u5141\u8bb8\u5916\u7f51\u8bbf\u95ee\u9700\u8981\u7279\u522b\u6ce8\u610f\u5b89\u5168\u95ee\u9898\uff0c\u56e0\u4e3a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5b83\u4ec5\u76d1\u542c\u672c\u5730\u8fde\u63a5\uff08<code>localhost<\/code>\uff09\u3002\u4e3a\u4e86\u5b89\u5168\u5730\u914d\u7f6e\u5916\u7f51\u8bbf\u95ee\uff0c\u4f60\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u4f7f\u7528SSH\u96a7\u9053<\/h3>\n\n\n\n<p>\u6700\u63a8\u8350\u7684\u65b9\u6cd5\u662f\u901a\u8fc7SSH\u96a7\u9053\u6765\u5b89\u5168\u5730\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684JupyterLab\u3002\u8fd9\u4e0d\u9700\u8981\u4fee\u6539\u9632\u706b\u5899\u6216\u516c\u5f00\u66b4\u9732\u4f60\u7684\u670d\u52a1\u5668\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b65\u9aa4\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u542f\u52a8JupyterLab\uff0c\u5e76\u786e\u4fdd\u5b83\u7ed1\u5b9a\u5230\u6240\u6709\u7f51\u7edc\u63a5\u53e3\uff08<code>0.0.0.0<\/code>\uff09\uff0c\u800c\u4e0d\u662f\u4ec5\u4ec5<code>localhost<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u672c\u5730\u673a\u5668\u4e0a\u4f7f\u7528SSH\u5ba2\u6237\u7aef\u8bbe\u7f6e\u96a7\u9053\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u8fdc\u7a0b\u670d\u52a1\u5668IP\u662f<code>your.server.ip<\/code>\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -L 8888:localhost:8888 your_username@your.server.ip<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7136\u540e\uff0c\u5728\u672c\u5730\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee <code>http:\/\/localhost:8888<\/code> \u5373\u53ef\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684JupyterLab\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u76f4\u63a5\u914d\u7f6eJupyterLab\u76d1\u542c\u6240\u6709\u7f51\u7edc\u63a5\u53e3\uff08\u4e0d\u63a8\u8350\u76f4\u63a5\u5f00\u653e\uff09<\/h3>\n\n\n\n<p>\u5982\u679c\u4f60\u786e\u5b9e\u9700\u8981\u8ba9JupyterLab\u76f4\u63a5\u5bf9\u5916\u7f51\u5f00\u653e\uff0c\u8bf7\u52a1\u5fc5\u91c7\u53d6\u989d\u5916\u7684\u5b89\u5168\u63aa\u65bd\uff0c\u5982\u4f7f\u7528HTTPS\u3001\u8bbe\u7f6e\u5bc6\u7801\u4fdd\u62a4\u6216\u4ee4\u724c\u9a8c\u8bc1\u7b49\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b65\u9aa4\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4fee\u6539Jupyter\u914d\u7f6e\u6587\u4ef6\uff08\u5982\u679c\u6ca1\u6709\u914d\u7f6e\u6587\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u521b\u5efa\uff09<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><code>jupyter lab --generate-config<\/code><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e3aJupyter\u8bbe\u7f6e\u5bc6\u7801\uff08\u5982\u679c\u5c1a\u672a\u8bbe\u7f6e\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1b\u6309\u7167\u63d0\u793a\u5b8c\u6210\u8f93\u5165\uff0c\u5e76\u590d\u5236\u54c8\u5e0c\u503c\uff0c\u4e0b\u4e00\u6b65\u8981\u7528 \uff09\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>jupyter server password<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7f16\u8f91\u751f\u6210\u7684\u914d\u7f6e\u6587\u4ef6\uff08\u901a\u5e38\u4f4d\u4e8e<code>~\/.jupyter\/jupyter_lab_config.py<\/code>\uff09\uff0c\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>c.ServerApp.ip = '0.0.0.0'  # \u5141\u8bb8\u6240\u6709IP\u5730\u5740\u8bbf\u95ee\nc.ServerApp.open_browser = False  # \u4e0d\u81ea\u52a8\u6253\u5f00\u6d4f\u89c8\u5668\nc.ServerApp.port = 8888  # \u8bbe\u7f6e\u7aef\u53e3\u53f7\nc.ServerApp.allow_remote_access = True  # \u5141\u8bb8\u8fdc\u7a0b\u8fde\u63a5\nc.ServerApp.password = u'sha1:...your hashed password here...'  # \u8bbe\u7f6e\u4e00\u4e2a\u5f3a\u5bc6\u7801<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u542f\u52a8JupyterLab\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>jupyter lab<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u914d\u7f6e\u53cd\u5411\u4ee3\u7406\uff08Nginx, Apache\u7b49\uff09<\/h3>\n\n\n\n<p>\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883\uff0c\u63a8\u8350\u4f7f\u7528\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff08\u5982Nginx\u6216Apache\uff09\u6765\u5904\u7406\u5916\u90e8\u8bf7\u6c42\uff0c\u5e76\u901a\u8fc7SSL\/TLS\u52a0\u5bc6\u901a\u4fe1\u3002\u8fd9\u6837\u4e0d\u4ec5\u53ef\u4ee5\u63d0\u9ad8\u5b89\u5168\u6027\uff0c\u8fd8\u53ef\u4ee5\u66f4\u597d\u5730\u7ba1\u7406\u6d41\u91cf\u548c\u63d0\u4f9b\u66f4\u7a33\u5b9a\u7684\u8bbf\u95ee\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b65\u9aa4\u6982\u89c8\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5\u5e76\u914d\u7f6e\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u3002<\/li>\n\n\n\n<li>\u5c06JupyterLab\u7ed1\u5b9a\u5230\u672c\u5730\u56de\u73af\u5730\u5740\uff08<code>127.0.0.1<\/code>\uff09\u3002<\/li>\n\n\n\n<li>\u914d\u7f6e\u53cd\u5411\u4ee3\u7406\u5c06\u5916\u90e8\u8bf7\u6c42\u8f6c\u53d1\u7ed9JupyterLab\u3002<\/li>\n\n\n\n<li>\u914d\u7f6eSSL\u8bc1\u4e66\u4ee5\u542f\u7528HTTPS\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u6ce8\u610f\u4e8b\u9879<\/h3>\n\n\n\n<p>\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u5e94\u8be5\u8003\u8651\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5b89\u5168\u6027<\/strong>\uff1a\u59cb\u7ec8\u786e\u4fdd\u4f7f\u7528\u5f3a\u5bc6\u7801\u6216\u4ee4\u724c\u9a8c\u8bc1\uff0c\u907f\u514d\u5728\u516c\u7f51\u4e0a\u66b4\u9732\u654f\u611f\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u9632\u706b\u5899\u89c4\u5219<\/strong>\uff1a\u53ea\u5141\u8bb8\u5fc5\u8981\u7684\u7aef\u53e3\u901a\u8fc7\u9632\u706b\u5899\uff0c\u51cf\u5c11\u653b\u51fb\u9762\u3002<\/li>\n\n\n\n<li><strong>\u5b9a\u671f\u66f4\u65b0<\/strong>\uff1a\u4fdd\u6301\u8f6f\u4ef6\u548c\u4f9d\u8d56\u9879\u7684\u6700\u65b0\u72b6\u6001\uff0c\u4fee\u8865\u5df2\u77e5\u6f0f\u6d1e\u3002<\/li>\n\n\n\n<li><strong>WSL\u4e2d<\/strong>\uff1a\u8bbf\u95ee\u5730\u5740\u662f173\u5f00\u5173\u7684\u5b50\u7f51\u3002<\/li>\n\n\n\n<li><strong>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u65f6<\/strong>\uff1a\u5f00\u5934\u4e0d\u8981\u6709\u7a7a\u683c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6839\u636e\u4f60\u7684\u5177\u4f53\u9700\u6c42\u548c\u6280\u672f\u6808\uff0c\u9009\u62e9\u6700\u9002\u5408\u7684\u65b9\u5f0f\u8fdb\u884c\u914d\u7f6e\u3002\u5982\u679c\u4f60\u5bf9\u7f51\u7edc\u5b89\u5168\u4e0d\u592a\u719f\u6089\uff0c\u5efa\u8bae\u4f18\u5148\u8003\u8651\u4f7f\u7528SSH\u96a7\u9053\u7684\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6eJupyterLab\u4ee5\u5141\u8bb8\u5916\u7f51\u8bbf\u95ee\u9700\u8981\u7279\u522b\u6ce8\u610f\u5b89\u5168\u95ee\u9898\uff0c\u56e0\u4e3a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5b83\u4ec5\u76d1\u542c\u672c\u5730\u8fde\u63a5\uff08localhost [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[34,36],"class_list":["post-420","post","type-post","status-publish","format-standard","hentry","category-linux","tag-jupyter","tag-jupyterlab"],"_links":{"self":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts\/420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/comments?post=420"}],"version-history":[{"count":0,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts\/420\/revisions"}],"wp:attachment":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/media?parent=420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/categories?post=420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/tags?post=420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}