{"id":1000655,"date":"2024-12-27T09:52:03","date_gmt":"2024-12-27T01:52:03","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1000655.html"},"modified":"2024-12-27T09:52:07","modified_gmt":"2024-12-27T01:52:07","slug":"%e5%a6%82%e4%bd%95%e5%85%b3%e9%97%adpython%e7%9a%84jupyter","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1000655.html","title":{"rendered":"\u5982\u4f55\u5173\u95edpython\u7684jupyter"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25075145\/d32d52ae-1b4f-4a21-b53d-caf844b077ff.webp\" alt=\"\u5982\u4f55\u5173\u95edpython\u7684jupyter\" \/><\/p>\n<p><p> <strong>\u5173\u95edPython\u7684Jupyter\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u5728Jupyter Notebook\u754c\u9762\u9009\u62e9\u201c\u5173\u95ed\u5e76\u505c\u6b62\u201d\u9009\u9879\u3001\u5728\u547d\u4ee4\u884c\u4e2d\u901a\u8fc7Ctrl+C\u4e2d\u65ad\u7a0b\u5e8f\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5173\u95edJupyter\u670d\u52a1\u3002<\/strong>\u5176\u4e2d\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u5173\u95edJupyter\u670d\u52a1\u662f\u4e00\u79cd\u8f83\u4e3a\u76f4\u63a5\u548c\u5f7b\u5e95\u7684\u65b9\u6cd5\u3002\u4f60\u53ef\u4ee5\u5728\u542f\u52a8Jupyter\u7684\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u6309\u4e0bCtrl+C\u952e\uff0c\u8fd9\u5c06\u4e2d\u65ad\u6b63\u5728\u8fd0\u884c\u7684Jupyter\u670d\u52a1\u5e76\u91ca\u653e\u76f8\u5e94\u7684\u7aef\u53e3\uff0c\u4ece\u800c\u5b8c\u6210\u5173\u95ed\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001JUPYTER NOTEBOOK\u754c\u9762\u5173\u95ed<\/p>\n<\/p>\n<p><p>Jupyter Notebook\u63d0\u4f9b\u4e86\u4e00\u4e2a\u53cb\u597d\u7684\u7528\u6237\u754c\u9762\uff0c\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u754c\u9762\u64cd\u4f5c\u6765\u5173\u95edNotebook\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5173\u95ed\u5e76\u505c\u6b62Notebook<\/strong><\/p>\n<\/p>\n<p><p>\u5728Jupyter Notebook\u754c\u9762\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u201c\u6587\u4ef6\u201d\u83dc\u5355\u9009\u62e9\u201c\u5173\u95ed\u5e76\u505c\u6b62\u201d\u9009\u9879\uff0c\u6765\u5173\u95ed\u5f53\u524d\u6253\u5f00\u7684Notebook\u3002\u8fd9\u5c06\u505c\u6b62\u8be5Notebook\u7684\u5185\u6838\uff0c\u91ca\u653e\u8d44\u6e90\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5173\u95ed\u6d4f\u89c8\u5668\u9009\u9879\u5361<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u53ea\u60f3\u5173\u95edJupyter Notebook\u7684\u67d0\u4e2a\u9009\u9879\u5361\u800c\u4e0d\u662f\u6574\u4e2a\u5e94\u7528\uff0c\u53ef\u4ee5\u76f4\u63a5\u5173\u95ed\u6d4f\u89c8\u5668\u9009\u9879\u5361\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u5e76\u4e0d\u4f1a\u505c\u6b62\u6b63\u5728\u8fd0\u884c\u7684\u5185\u6838\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u505c\u6b62\u6240\u6709\u5185\u6838<\/strong><\/p>\n<\/p>\n<p><p>\u5728Jupyter Notebook\u754c\u9762\u53f3\u4e0a\u89d2\u6709\u4e00\u4e2a\u201c\u5185\u6838\u201d\u83dc\u5355\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u201c\u5173\u95ed\u5e76\u505c\u6b62\u6240\u6709\u5185\u6838\u201d\u4ee5\u505c\u6b62\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u5185\u6838\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u547d\u4ee4\u884c\u4e2d\u65ad<\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8\u7684Jupyter Notebook\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u6765\u4e2d\u65ad\u5e76\u5173\u95ed\u670d\u52a1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Ctrl+C\u4e2d\u65ad<\/strong><\/p>\n<\/p>\n<p><p>\u5f53\u60a8\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c<code>jupyter notebook<\/code>\u547d\u4ee4\u542f\u52a8Jupyter\u540e\uff0cJupyter\u4f1a\u5728\u8be5\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u8fd0\u884c\u3002\u60a8\u53ef\u4ee5\u6309\u4e0bCtrl+C\u7ec4\u5408\u952e\u6765\u4e2d\u65ad\u8be5\u8fdb\u7a0b\u3002\u8fd9\u5c06\u505c\u6b62Jupyter Notebook\u670d\u52a1\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u624b\u52a8\u7ec8\u6b62\u8fdb\u7a0b<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679cCtrl+C\u65e0\u6cd5\u6b63\u5e38\u4e2d\u65ad\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4efb\u52a1\u7ba1\u7406\u5668\uff08Windows\uff09\u6216\u4f7f\u7528<code>ps<\/code>\u548c<code>kill<\/code>\u547d\u4ee4\uff08Linux\/Mac\uff09\u6765\u624b\u52a8\u7ec8\u6b62Jupyter Notebook\u8fdb\u7a0b\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5173\u95ed<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u76f4\u63a5\u4e2d\u65ad\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u547d\u4ee4\u6765\u5173\u95ed\u6b63\u5728\u8fd0\u884c\u7684Jupyter\u670d\u52a1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>jupyter notebook stop<\/strong><\/p>\n<\/p>\n<p><p>Jupyter\u63d0\u4f9b\u4e86\u4e00\u4e2a\u547d\u4ee4<code>jupyter notebook stop<\/code>\uff0c\u53ef\u4ee5\u7528\u4e8e\u5173\u95ed\u6b63\u5728\u8fd0\u884c\u7684Jupyter\u670d\u52a1\u3002\u60a8\u9700\u8981\u63d0\u4f9bJupyter\u670d\u52a1\u7684\u7aef\u53e3\u53f7\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code>jupyter notebook stop 8888<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5173\u95ed\u8fd0\u884c\u5728\u7aef\u53e38888\u4e0a\u7684Jupyter Notebook\u670d\u52a1\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528<code>kill<\/code>\u547d\u4ee4<\/strong><\/p>\n<\/p>\n<p><p>\u5728Linux\u6216Mac\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>ps<\/code>\u547d\u4ee4\u627e\u5230Jupyter Notebook\u7684\u8fdb\u7a0bID\uff0c\u7136\u540e\u4f7f\u7528<code>kill<\/code>\u547d\u4ee4\u6765\u7ec8\u6b62\u8be5\u8fdb\u7a0b\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code>ps aux | grep jupyter<\/p>\n<p>kill -9 &lt;PID&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5f3a\u5236\u5173\u95edJupyter Notebook\u670d\u52a1\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5173\u95edJupyter Lab<\/p>\n<\/p>\n<p><p>Jupyter Lab\u662fJupyter\u9879\u76ee\u7684\u4e0b\u4e00\u4ee3\u7528\u6237\u754c\u9762\uff0c\u5b83\u4e0eJupyter Notebook\u7684\u5173\u95ed\u65b9\u6cd5\u7c7b\u4f3c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u754c\u9762\u5173\u95ed<\/strong><\/p>\n<\/p>\n<p><p>\u5728Jupyter Lab\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u201c\u6587\u4ef6\u201d\u83dc\u5355\u9009\u62e9\u201c\u5173\u95ed\u5e76\u505c\u6b62\u201d\u9009\u9879\u6765\u5173\u95ed\u7279\u5b9a\u7684Notebook\u6216\u7ec8\u6b62\u6240\u6709\u5185\u6838\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u547d\u4ee4\u884c\u4e2d\u65ad<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Jupyter Lab\u540e\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528Ctrl+C\u7ec4\u5408\u952e\u6765\u4e2d\u65ad\u548c\u5173\u95ed\u670d\u52a1\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u547d\u4ee4\u884c\u5173\u95ed<\/strong><\/p>\n<\/p>\n<p><p>\u4e0eJupyter Notebook\u7c7b\u4f3c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>jupyter lab stop<\/code>\u547d\u4ee4\u6765\u5173\u95ed\u6b63\u5728\u8fd0\u884c\u7684Jupyter Lab\u670d\u52a1\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5173\u95edJupyterHub<\/p>\n<\/p>\n<p><p>JupyterHub\u5141\u8bb8\u591a\u4e2a\u7528\u6237\u5728\u4e00\u4e2a\u670d\u52a1\u5668\u4e0a\u4f7f\u7528Jupyter Notebook\u3002\u5173\u95edJupyterHub\u9700\u8981\u6709\u7ba1\u7406\u5458\u6743\u9650\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u547d\u4ee4\u884c\u5173\u95ed<\/strong><\/p>\n<\/p>\n<p><p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u505c\u6b62JupyterHub\u670d\u52a1\uff0c\u901a\u5e38\u4f7f\u7528\u7684\u662f<code>systemctl<\/code>\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo systemctl stop jupyterhub<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7ec8\u6b62\u6240\u6709\u7528\u6237\u7684\u5185\u6838<\/strong><\/p>\n<\/p>\n<p><p>\u4f5c\u4e3aJupyterHub\u7ba1\u7406\u5458\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u7ec8\u6b62\u6240\u6709\u7528\u6237\u7684\u5185\u6838\u5e76\u505c\u6b62\u6574\u4e2a\u670d\u52a1\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u4f1a\u5f71\u54cd\u5230\u6240\u6709\u4f7f\u7528JupyterHub\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u6ce8\u610f\u4e8b\u9879<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6570\u636e\u4fdd\u5b58<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5173\u95edJupyter Notebook\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u6240\u6709\u91cd\u8981\u6570\u636e\u548c\u4ee3\u7801\u5df2\u7ecf\u4fdd\u5b58\u3002\u672a\u4fdd\u5b58\u7684\u5de5\u4f5c\u5728\u5173\u95ed\u540e\u5c06\u4f1a\u4e22\u5931\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5185\u6838\u505c\u6b62<\/strong><\/p>\n<\/p>\n<p><p>\u5173\u95edNotebook\u5e76\u4e0d\u603b\u662f\u610f\u5473\u7740\u5185\u6838\u5df2\u7ecf\u505c\u6b62\u3002\u8bf7\u68c0\u67e5Jupyter\u754c\u9762\u4ee5\u786e\u4fdd\u5185\u6838\u5df2\u88ab\u6b63\u786e\u505c\u6b62\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7aef\u53e3\u91ca\u653e<\/strong><\/p>\n<\/p>\n<p><p>\u5173\u95edJupyter\u670d\u52a1\u540e\uff0c\u5e94\u786e\u4fdd\u5176\u5360\u7528\u7684\u7aef\u53e3\u5df2\u7ecf\u88ab\u91ca\u653e\uff0c\u4ee5\u4fbf\u4e0b\u6b21\u542f\u52a8\u65f6\u4e0d\u4f1a\u53d1\u751f\u51b2\u7a81\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f\u6765\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u5173\u95edPython\u7684Jupyter\u670d\u52a1\u3002\u65e0\u8bba\u662f\u901a\u8fc7\u754c\u9762\u64cd\u4f5c\u8fd8\u662f\u547d\u4ee4\u884c\u547d\u4ee4\uff0c\u5173\u952e\u5728\u4e8e\u786e\u4fdd\u5173\u95ed\u540e\u7684\u6570\u636e\u5b89\u5168\u548c\u8d44\u6e90\u91ca\u653e\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5b89\u5168\u5730\u505c\u6b62\u6b63\u5728\u8fd0\u884c\u7684Jupyter Notebook\uff1f<\/strong><br \/>\u5728\u4f7f\u7528Jupyter Notebook\u65f6\uff0c\u5982\u679c\u4f60\u60f3\u5b89\u5168\u5730\u505c\u6b62\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684Notebook\uff0c\u53ef\u4ee5\u5728Notebook\u754c\u9762\u7684\u4e0a\u65b9\u627e\u5230\u201cKernel\u201d\u9009\u9879\u3002\u5728\u4e0b\u62c9\u83dc\u5355\u4e2d\uff0c\u9009\u62e9\u201cInterrupt\u201d\u53ef\u4ee5\u4e2d\u65ad\u5f53\u524d\u7684\u4ee3\u7801\u6267\u884c\u3002\u82e5\u9700\u5b8c\u5168\u5173\u95edNotebook\uff0c\u9009\u62e9\u201cShutdown\u201d\u9009\u9879\u5c06\u5173\u95ed\u8be5Notebook\u7684\u5185\u6838\u3002<\/p>\n<p><strong>\u5173\u95edJupyter Notebook\u540e\uff0c\u5982\u4f55\u786e\u4fdd\u6ca1\u6709\u8fdb\u7a0b\u4ecd\u5728\u8fd0\u884c\uff1f<\/strong><br \/>\u5173\u95edJupyter Notebook\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u67e5\u770b\u662f\u5426\u6709\u76f8\u5173\u7684Python\u8fdb\u7a0b\u4ecd\u5728\u8fd0\u884c\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>jupyter notebook stop<\/code>\uff0c\u7136\u540e\u67e5\u627e\u662f\u5426\u6709\u4ecd\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002\u5982\u679c\u6709\uff0c\u53ef\u4ee5\u624b\u52a8\u7ed3\u675f\u8fd9\u4e9b\u8fdb\u7a0b\uff0c\u4ee5\u786e\u4fdd\u4e0d\u4f1a\u5360\u7528\u7cfb\u7edf\u8d44\u6e90\u3002<\/p>\n<p><strong>\u5982\u4f55\u901a\u8fc7\u547d\u4ee4\u884c\u5173\u95edJupyter Notebook\uff1f<\/strong><br \/>\u5982\u679c\u60a8\u66f4\u559c\u6b22\u4f7f\u7528\u547d\u4ee4\u884c\uff0c\u5173\u95edJupyter Notebook\u7684\u8fc7\u7a0b\u4e5f\u5f88\u7b80\u5355\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>jupyter notebook list<\/code>\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u8fd0\u884c\u7684Notebook\u53ca\u5176\u5bf9\u5e94\u7684URL\u3002\u8bb0\u4e0b\u9700\u8981\u5173\u95ed\u7684Notebook\u7684URL\uff0c\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>jupyter notebook stop &lt;\u7aef\u53e3\u53f7&gt;<\/code>\uff08\u901a\u5e38\u662f8888\uff09\uff0c\u5373\u53ef\u5173\u95ed\u6240\u6709\u901a\u8fc7\u8be5\u7aef\u53e3\u542f\u52a8\u7684Jupyter Notebook\u5b9e\u4f8b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5173\u95edPython\u7684Jupyter\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u5728Jupyter Notebook\u754c\u9762\u9009\u62e9\u201c\u5173\u95ed\u5e76\u505c\u6b62\u201d [&hellip;]","protected":false},"author":3,"featured_media":1000669,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1000655"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1000655"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1000655\/revisions"}],"predecessor-version":[{"id":1000672,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1000655\/revisions\/1000672"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1000669"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1000655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1000655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1000655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}