{"id":4165,"date":"2022-08-06T15:47:01","date_gmt":"2022-08-06T13:47:01","guid":{"rendered":"http:\/\/ucthpc.uct.ac.za\/?p=4165"},"modified":"2022-08-06T15:51:53","modified_gmt":"2022-08-06T13:51:53","slug":"jupyter-notebook","status":"publish","type":"post","link":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/","title":{"rendered":"Jupyter Notebook"},"content":{"rendered":"<p>If you want to run Jupyter Notebook on the cluster and work in this from your desktop the following may help.<\/p>\n<p>As you do not have write access to the software volume you will need to do a local install, please look at the guidelines <a href=\"https:\/\/ucthpc.uct.ac.za\/index.php\/adding-libraries\/\">here for doing a local pip install<\/a>.<\/p>\n<p>Do not use the standard system version of anaconda. Rather activate one of the cluster versions inside of an interactive job. An example:<\/p>\n<pre>sintx --ntasks=4\r\nmodule load python\/miniconda3-py39\r\npip install --user jupyter\r\nexit<\/pre>\n<p>Now jupyter is installed, you only need to do the above once. To use it start an interactive job, load the module and start jupyter. NB, do not run jupyter on the head node, use an interactive job!<\/p>\n<pre>sintx --ntasks=4\r\nmodule load python\/miniconda3-py39\r\njupyter notebook --no-browser<\/pre>\n<p>Make a note of the published URL to access jupyter, it will most likely be 8888 but may be different if this port is already being used by someone:<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-4168 size-full\" src=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2.jpg\" alt=\"\" width=\"800\" height=\"155\" srcset=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2.jpg 800w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2-300x58.jpg 300w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2-600x116.jpg 600w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2-768x149.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<pre>http:\/\/localhost:8888\/?token=3aac4c26e1d82als723f73be5fe0347easf7ea59dbcda<\/pre>\n<p>On your desktop activate a port forwarding session in a command prompt:<\/p>\n<p>ssh -N -L localhost:<span style=\"color: #ff0000;\"><strong>8889<\/strong><\/span>:localhost:8888 <em>myhpcusername<\/em>@srvcnthpc102.uct.ac.za<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-1-1.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-4175 size-full\" src=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-1-1.jpg\" alt=\"\" width=\"795\" height=\"131\" srcset=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-1-1.jpg 795w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-1-1-300x49.jpg 300w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-1-1-600x99.jpg 600w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-1-1-768x127.jpg 768w\" sizes=\"(max-width: 795px) 100vw, 795px\" \/><\/a><\/p>\n<p>Ignore the key error, enter yes, then enter your password. No further responses are required, just leave this running.<\/p>\n<p>Here 8888 is the port from the published URL above and srvcnthpc103 is the worker node where you&#8217;re running your interactive job (hint: look at the prompt to get the name of the worker node).<\/p>\n<p>Open a browser on your desktop and paste the URL you got from jupyter remembering to change the port number to the listening port on your desktop, <span style=\"color: #ff0000;\"><strong>8889<\/strong><\/span>:<\/p>\n<pre>http:\/\/localhost:<strong><span style=\"color: #ff0000;\">8889<\/span><\/strong>\/?token=574e786ada1574f5ec97dbb219dd157b223789519cd3e6fa<\/pre>\n<p>You should now see notebooks running in your browser:<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-3.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-4170 size-full\" src=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-3.jpg\" alt=\"\" width=\"800\" height=\"155\" srcset=\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-3.jpg 800w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-3-300x58.jpg 300w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-3-600x116.jpg 600w, https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-3-768x149.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>If you get an error in your browser make sure that you remembered to change the port number in the URL from 8888 to 8889<\/p>\n<p>Once done you should close down you command line ssh session on your desktop, exit the jupyter notebook in your interactive job with ctrl-c, then type exit to terminate your job.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to run Jupyter Notebook on the cluster and work in this from your desktop the following may help. As you do not have write access to the software volume you will need to do a local install, please look at the guidelines here for doing a local pip install. Do not use&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Jupyter Notebook - UCT HPC<\/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:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jupyter Notebook - UCT HPC\" \/>\n<meta property=\"og:description\" content=\"If you want to run Jupyter Notebook on the cluster and work in this from your desktop the following may help. As you do not have write access to the software volume you will need to do a local install, please look at the guidelines here for doing a local pip install. Do not use...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/\" \/>\n<meta property=\"og:site_name\" content=\"UCT HPC\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-06T13:47:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-06T13:51:53+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2.jpg\" \/>\n<meta name=\"author\" content=\"Andrew Lewis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Lewis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/\"},\"author\":{\"name\":\"Andrew Lewis\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e\"},\"headline\":\"Jupyter Notebook\",\"datePublished\":\"2022-08-06T13:47:01+00:00\",\"dateModified\":\"2022-08-06T13:51:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/\"},\"wordCount\":308,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#organization\"},\"articleSection\":[\"application\"],\"inLanguage\":\"en-ZA\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/\",\"name\":\"Jupyter Notebook - UCT HPC\",\"isPartOf\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#website\"},\"datePublished\":\"2022-08-06T13:47:01+00:00\",\"dateModified\":\"2022-08-06T13:51:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#breadcrumb\"},\"inLanguage\":\"en-ZA\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ucthpc.uct.ac.za\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Jupyter Notebook\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#website\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/\",\"name\":\"UCT HPC\",\"description\":\"University of Cape Town High Performance Computing\",\"publisher\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ucthpc.uct.ac.za\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-ZA\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#organization\",\"name\":\"University of Cape Town High Performance Computing\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-ZA\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png\",\"contentUrl\":\"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png\",\"width\":450,\"height\":423,\"caption\":\"University of Cape Town High Performance Computing\"},\"image\":{\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e\",\"name\":\"Andrew Lewis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-ZA\",\"@id\":\"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g\",\"caption\":\"Andrew Lewis\"},\"sameAs\":[\"http:\/\/blogs.uct.ac.za\/blog\/big-bytes\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Jupyter Notebook - UCT HPC","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:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/","og_locale":"en_US","og_type":"article","og_title":"Jupyter Notebook - UCT HPC","og_description":"If you want to run Jupyter Notebook on the cluster and work in this from your desktop the following may help. As you do not have write access to the software volume you will need to do a local install, please look at the guidelines here for doing a local pip install. Do not use...","og_url":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/","og_site_name":"UCT HPC","article_published_time":"2022-08-06T13:47:01+00:00","article_modified_time":"2022-08-06T13:51:53+00:00","og_image":[{"url":"http:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2022\/08\/Untitled-2.jpg"}],"author":"Andrew Lewis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Lewis","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#article","isPartOf":{"@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/"},"author":{"name":"Andrew Lewis","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e"},"headline":"Jupyter Notebook","datePublished":"2022-08-06T13:47:01+00:00","dateModified":"2022-08-06T13:51:53+00:00","mainEntityOfPage":{"@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/"},"wordCount":308,"commentCount":0,"publisher":{"@id":"https:\/\/ucthpc.uct.ac.za\/#organization"},"articleSection":["application"],"inLanguage":"en-ZA","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/","url":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/","name":"Jupyter Notebook - UCT HPC","isPartOf":{"@id":"https:\/\/ucthpc.uct.ac.za\/#website"},"datePublished":"2022-08-06T13:47:01+00:00","dateModified":"2022-08-06T13:51:53+00:00","breadcrumb":{"@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#breadcrumb"},"inLanguage":"en-ZA","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ucthpc.uct.ac.za\/index.php\/2022\/08\/06\/jupyter-notebook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ucthpc.uct.ac.za\/"},{"@type":"ListItem","position":2,"name":"Jupyter Notebook"}]},{"@type":"WebSite","@id":"https:\/\/ucthpc.uct.ac.za\/#website","url":"https:\/\/ucthpc.uct.ac.za\/","name":"UCT HPC","description":"University of Cape Town High Performance Computing","publisher":{"@id":"https:\/\/ucthpc.uct.ac.za\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ucthpc.uct.ac.za\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-ZA"},{"@type":"Organization","@id":"https:\/\/ucthpc.uct.ac.za\/#organization","name":"University of Cape Town High Performance Computing","url":"https:\/\/ucthpc.uct.ac.za\/","logo":{"@type":"ImageObject","inLanguage":"en-ZA","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/","url":"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png","contentUrl":"https:\/\/ucthpc.uct.ac.za\/wp-content\/uploads\/2015\/09\/logocircless.png","width":450,"height":423,"caption":"University of Cape Town High Performance Computing"},"image":{"@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/c183ad1c0a1063124a72d63963ae9c7e","name":"Andrew Lewis","image":{"@type":"ImageObject","inLanguage":"en-ZA","@id":"https:\/\/ucthpc.uct.ac.za\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9652c9c73beeab594b8dc2383a880048?s=96&d=mm&r=g","caption":"Andrew Lewis"},"sameAs":["http:\/\/blogs.uct.ac.za\/blog\/big-bytes"]}]}},"_links":{"self":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts\/4165"}],"collection":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/comments?post=4165"}],"version-history":[{"count":5,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts\/4165\/revisions"}],"predecessor-version":[{"id":4176,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/posts\/4165\/revisions\/4176"}],"wp:attachment":[{"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/media?parent=4165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/categories?post=4165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ucthpc.uct.ac.za\/index.php\/wp-json\/wp\/v2\/tags?post=4165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}