{"id":45872,"date":"2023-09-26T18:05:04","date_gmt":"2023-04-09T15:33:37","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/45872-2\/"},"modified":"2024-05-04T01:41:58","modified_gmt":"2024-05-03T17:41:58","slug":"45872-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/45872-2\/","title":{"rendered":""},"content":{"rendered":"<p>Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u691c\u8a3c\u7528\u3067\u4f7f\u3044\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u51fa\u6765\u308b\u9650\u308a\u30b7\u30f3\u30d7\u30eb\u3001\u30b9\u30d4\u30fc\u30c7\u30a3\u306bJupyter Notebook\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u8d77\u52d5\u3055\u305b\u308b\u624b\u9806\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0<\/h2>\n<p>Python3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f<br \/>\nAnaconda3\u3092\u4f7f\u3044Jupyter Notebook\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\nroot\u30e6\u30fc\u30b6\u3067\u5b9f\u884c<br \/>\n\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u3092\u4f7f\u3046<\/p>\n<h2>Jupyter Notebook\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<h3>Anaconda\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h3>\n<pre class=\"post-pre\"><code>curl https:\/\/repo.continuum.io\/archive\/Anaconda3-4.3.1-Linux-x86_64.sh -O\r\n<\/code><\/pre>\n<h3>\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<pre class=\"post-pre\"><code>yum install bzip2 -y\r\n<\/code><\/pre>\n<h3>Anaconda\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<pre class=\"post-pre\"><code>bash .\/Anaconda3-4.3.1-Linux-x86_64.sh \r\n\u203b\u4ee5\u4e0b\u5bfe\u8a71\u5f62\u5f0f\u3067\u9032\u307f\u307e\u3059\u3002\r\n\r\nWelcome to Anaconda3 4.3.1 (by Continuum Analytics, Inc.)\r\nIn order to continue the installation process, please review the license\r\nagreement.\r\nPlease, press ENTER to continue\r\n&gt;&gt;&gt; \u305d\u306e\u307e\u307eEnter\u3002\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u8aad\u307f\u9032\u3081\u3066\u3044\u304f\u3002\r\n\r\nDo you approve the license terms? [yes|no]\r\n&gt;&gt;&gt;yes\r\n\r\nAnaconda3 will now be installed into this location:\r\n\/root\/anaconda3\r\n\r\n  - Press ENTER to confirm the location\r\n  - Press CTRL-C to abort the installation\r\n  - Or specify a different location below\r\n\r\n[\/root\/anaconda3] &gt;&gt;&gt;\u305d\u306e\u307e\u307eEnter\r\n\r\nDo you wish the installer to prepend the Anaconda3 install location\r\nto PATH in your \/root\/.bashrc ? [yes|no]\r\n[no] &gt;&gt;&gt;yes\r\n\u203bbashrc\u306b\u30d1\u30b9\u3092\u901a\u3059\u8a2d\u5b9a\u304c\u5165\u308b\u3002\r\n<\/code><\/pre>\n<h3>bashrc\u8aad\u307f\u8fbc\u307f<\/h3>\n<pre class=\"post-pre\"><code>source ~\/.bashrc\r\n<\/code><\/pre>\n<h3>Jupyter\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<\/h3>\n<pre class=\"post-pre\"><code>jupyter --version\r\n<\/code><\/pre>\n<h2>Jupyter Notebook\u8a2d\u5b9a<\/h2>\n<h3>\u30b3\u30f3\u30d5\u30a3\u30b0\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u306e\u524d\u306b\u3044\u304f\u3064\u304b\u5b9f\u65bd\u3002<\/h3>\n<pre class=\"post-pre\"><code># Config\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\r\njupyter --path\r\n\u203b\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b .jupter\u3068\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u308b\u3053\u3068\u3002\r\n\r\n# config\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\r\nmkdir ~\/.jupyter\r\ntouch ~\/.jupyter\/jupyter_notebook_config.py\r\n\r\n# Jupyter\u7528\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4f5c\u6210\u3002\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\u3002\r\nmkdir ~\/jupyter_files\r\ntouch ~\/jupyter_files\/test.py\r\n\r\n# iPython\u3067\u30ed\u30b0\u30a4\u30f3\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\r\nipython\r\n\u203b\u4ee5\u4e0b\u5165\u529b\r\n\r\n\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u6697\u53f7\u5316\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u8aad\u307f\u8fbc\u307f\r\nIn [1]: from notebook.auth import passwd\r\n\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\r\nIn [2]: passwd()\r\nEnter password: \r\nVerify password:\r\nOut[2]: 'sha1\u3067\u6697\u53f7\u5316\u3055\u308c\u305f\u6587\u5b57\u5217\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u3067\u30e1\u30e2\u3059\u308b'\r\n\u30fb\u629c\u3051\u308b\r\nIn [3]: exit\r\n<\/code><\/pre>\n<h3>\u30b3\u30f3\u30d5\u30a3\u30b0\u7de8\u96c6<\/h3>\n<pre class=\"post-pre\"><code>vi ~\/.jupyter\/jupyter_notebook_config.py\r\n\u203b\u4ee5\u4e0b\u8a18\u8f09\u3002\u3059\u3079\u3066\u306eIP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u63a5\u7d9a\u3092\u53d7\u3051\u5165\u308c\u30018888\u756a\u30dd\u30fc\u30c8\u3067\u8d77\u52d5\u3059\u308b\u8a2d\u5b9a\u3002\r\n\r\nc = get_config()\r\n\r\nc.NotebookApp.ip = '*'\r\nc.NotebookApp.open_browser = False\r\nc.NotebookApp.port = 8888\r\nc.NotebookApp.password = u'\u5148\u7a0b\u51fa\u529b\u3055\u308c\u305fsha1\u304b\u3089\u59cb\u307e\u308b\u6697\u53f7\u5316\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a18\u8f09'\r\nc.NotebookApp.notebook_dir = '\/root\/jupyter_files\/'\r\n<\/code><\/pre>\n<h2>Jupyter Notebook\u8d77\u52d5<\/h2>\n<h3>Jupyter Notebook\u306e\u5b9f\u884c<\/h3>\n<pre class=\"post-pre\"><code>jupyter notebook\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d61e137434c4406cfe7f5\/22-0.png\" alt=\"\u30ad\u30e3\u30d7\u30c1\u30e3.PNG\" \/><\/div>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d61e137434c4406cfe7f5\/23-0.png\" alt=\"\u30ad\u30e3\u30d7\u30c1\u30e32.PNG\" \/><\/div>\n<h2>Jupyter\u3092systemd\u3067\u5236\u5fa1\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h2>\n<h3>Jupyter\u306e\u30d1\u30b9\u3092\u78ba\u8a8d<\/h3>\n<pre class=\"post-pre\"><code>which jupyter\r\n\/root\/anaconda3\/bin\/jupyter\r\n<\/code><\/pre>\n<h3>Unit\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210<\/h3>\n<pre class=\"post-pre\"><code>vi \/etc\/systemd\/system\/notebook.service\r\n\u203b\u4ee5\u4e0b\u8a18\u8f09\r\n\r\n[Unit]\r\nDescription = Jupyter Notebook\r\n\r\n[Service]\r\nType=simple\r\nPIDFile=\/var\/run\/jupyter-notebook.pid\r\nExecStart=\/root\/anaconda3\/bin\/jupyter notebook\r\nWorkingDirectory=\/root\/\r\nUser=root\r\nGroup=root\r\nRestart=always\r\n\r\n[Install]\r\nWantedBy = multi-user.target\r\n\r\nsystemctl daemon-reload\r\n<\/code><\/pre>\n<h3>\u8d77\u52d5\u3001\u81ea\u52d5\u8d77\u52d5<\/h3>\n<pre class=\"post-pre\"><code>systemctl daemon-reload\r\nsystemctl start notebook\r\nsystemctl enable notebook\r\nsystemctl status notebook\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3067Jupyter Notebook\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u8d77\u52d5\u3055\u305b\u308b\u3068\u3053\u308d\u307e\u3067\u306f\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u691c\u8a3c\u7528\u3067\u4f7f\u3044\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u51fa\u6765\u308b\u9650\u308a\u30b7\u30f3\u30d7\u30eb\u3001\u30b9\u30d4\u30fc\u30c7\u30a3\u306bJupyter No [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-45872","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\/45872-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:description\" content=\"Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u691c\u8a3c\u7528\u3067\u4f7f\u3044\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u51fa\u6765\u308b\u9650\u308a\u30b7\u30f3\u30d7\u30eb\u3001\u30b9\u30d4\u30fc\u30c7\u30a3\u306bJupyter No [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/45872-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-09T15:33:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-03T17:41:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d61e137434c4406cfe7f5\/22-0.png\" \/>\n<meta name=\"author\" content=\"\u6e05, \u5b87\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u5b87\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \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\/45872-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/45872-2\/\",\"name\":\"- Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-09T15:33:37+00:00\",\"dateModified\":\"2024-05-03T17:41:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/45872-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\/1a6ecd3d914d22a5ac32791ffc1fbd8e\",\"name\":\"\u6e05, \u5b87\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u5b87\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/45872-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\/45872-2\/","og_locale":"zh_CN","og_type":"article","og_description":"Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u691c\u8a3c\u7528\u3067\u4f7f\u3044\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u51fa\u6765\u308b\u9650\u308a\u30b7\u30f3\u30d7\u30eb\u3001\u30b9\u30d4\u30fc\u30c7\u30a3\u306bJupyter No [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/45872-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-09T15:33:37+00:00","article_modified_time":"2024-05-03T17:41:58+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d61e137434c4406cfe7f5\/22-0.png"}],"author":"\u6e05, \u5b87","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u5b87","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/45872-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/45872-2\/","name":"- Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-09T15:33:37+00:00","dateModified":"2024-05-03T17:41:58+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/45872-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\/1a6ecd3d914d22a5ac32791ffc1fbd8e","name":"\u6e05, \u5b87","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g","caption":"\u6e05, \u5b87"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/45872-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\/45872","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=45872"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/45872\/revisions"}],"predecessor-version":[{"id":95349,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/45872\/revisions\/95349"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=45872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=45872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=45872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}