{"id":2432,"date":"2018-11-28T14:37:31","date_gmt":"2018-11-28T14:37:31","guid":{"rendered":"https:\/\/research.reading.ac.uk\/act\/?post_type=kbe_knowledgebase&#038;p=2432"},"modified":"2024-07-24T14:29:45","modified_gmt":"2024-07-24T13:29:45","slug":"python-on-the-academic-computing-cluster","status":"publish","type":"kbe_knowledgebase","link":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/","title":{"rendered":"Python on the Academic Computing Cluster"},"content":{"rendered":"<p>The recommended python distribution on\u00a0 the <a href=\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/academic-cluster-usage\/\">Reading Academic Computing Cluster (RACC) <\/a>is <a href=\"https:\/\/www.anaconda.com\/products\/individual\">Anaconda Individual Edition<\/a>. It is installed centrally with the standard set op packages, and can be accessed with the &#8216;<a href=\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/accessing-software-on-the-cluster\/\">module<\/a>&#8216; command. Anaconda provides a large collection of scientific packages, and not only python based ones. Those packages can be installed by users in their home directories using conda user environments.<\/p>\n<p>Note that the Python environment packaged with the operating system is also installed and this is the environment you get when you type &#8216;python&#8217; with no python module loaded.<\/p>\n<p>Python 3 is fundamentally different from, and not compatible with Python 2. Some Python 2.7 programs might still be in use. Previously the modules running Python 2.7 were grouped under &#8216;python2.7\/&#8230;&#8217;. and the modules loading Python 3 environments are grouped under &#8216;python3\/&#8230;&#8217;. The new version of Anaconda is now installed under module name anaconda, the base environment is with python 3.8, and we recommend the users requiring python 2.7 should just create user environments with this old version of python.\u00a0 Check with the command &#8216;module avail &#8216; for the full list of options on the RACC.<\/p>\n<p>&nbsp;<\/p>\n<h6><span style=\"text-decoration: underline\">Quick start with Anaconda<\/span><\/h6>\n<p>The easiest way to start using Anaconda is with it&#8217;s GUI called Anaconda Navigator. To launch it we need to load the &#8216;<a href=\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/accessing-software-on-the-cluster\/\">module<\/a>&#8216; :<\/p>\n<pre class=\"nums:false lang:default decode:true\">module load anaconda<\/pre>\n<p>Then we can use anaconda from the command line or we start the GUI by typing:<\/p>\n<pre class=\"nums:false lang:default decode:true\">anaconda-navigator<\/pre>\n<p>From Anaconda Navigator you can launch various GUI application, and you can install more application and packages in your personal user environments.\u00a0 For more instruction, please refer to the\u00a0<a href=\"https:\/\/docs.anaconda.com\/anaconda\/\">Anaconda documentation<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h6><span style=\"text-decoration: underline\">Notes about user environments<\/span><\/h6>\n<p>Your user environments will be located in the directory .conda in your home directory. If you decide to create an environment that contains all the default Anaconda packages, by installing the package &#8216;anaconda&#8217;, it will take around 3GB of space, and even more space will be used when you install further packages. \u00a0It is not possible to set this up in a different location. Home directories can easily fill up, causing various computing issues, so please be mindful of this when you choose to install your own Python environments.<\/p>\n<p>When you start you will see the base environment, this is where you land when you load the module, and other centrally managed environments (if any are provided in the future). If you used Anaconda before, you might also see your personal environments you created in the past, possibly with some older versions of anaconda.<\/p>\n<p>&nbsp;<\/p>\n<h6><span style=\"text-decoration: underline\">Managing user environments from the command line<\/span><\/h6>\n<p>Typical installation of Anaconda adds some lines in your .bashrc file, such that an init script is sourced and some shell function are define. We do not fully perform this initialisation when you load a module, the function are not defined then. This is why the following commands might be slightly different than in the instructions provided by Anaconda (e.g. we use &#8216;source activate&#8217;, not &#8216;conda activate&#8217;). After loading module anaconda you are in the &#8216;base&#8217; environment, although we do not show this in the shell prompt.<\/p>\n<p>First you&#8217;ll need to load the anaconda module, the most up to date version is available with the command:<\/p>\n<pre class=\"nums:false lang:default decode:true\">module load anaconda<\/pre>\n<p>Note that you can specify the Python version you want at the time of creating your environment. The instructions are the same whether you want Python 2.7 or 3.5, just specify your preferred version accordingly in the &#8216;conda create&#8217; command below.<\/p>\n<p>You can now create your own environment (called &#8216;myenv&#8217; in our example here) with the following command:<\/p>\n<pre class=\"nums:false lang:default decode:true \">conda create -n myenv python=X.X<\/pre>\n<p>Substitute &#8216;X.X&#8217; with the Python version that you want to install in your environment in the command above, e.g. 2.7 or 3.5. If you don&#8217;t have a preferred python version, you can remove the python=X.X part.<\/p>\n<p>You will only need to run the above command once. It creates an empty environment with the name &#8216;myenv&#8217;. Once finished, you can call your own environment from the terminal shell with:<\/p>\n<pre class=\"nums:false lang:default decode:true \">source activate myenv<\/pre>\n<p>Note that the anaconda module has to be loaded in order for this to work. When your environment is successfully loaded, the terminal prompt is preceded by &#8216;(myenv)&#8217;, e.g.:<\/p>\n<pre class=\"nums:false lang:default decode:true\">(myenv2) [dk913223@racc-login-0-1 ~]$<\/pre>\n<p>Now you can install your own packages in your environment with:<\/p>\n<pre class=\"nums:false lang:default decode:true\">conda install packagename<\/pre>\n<p>Note that in addition to the default package channel, other channels (package repositories), e.g. widely used conda-forge, are available. Often you can quickly find how to install software using conda, e.g. when you don&#8217;t know the exact conda package name, or what channel to use, form Google. \u00a0 If the package you require is not found via the &#8216;conda&#8217; command, you can also try using &#8216;pip&#8217;:<\/p>\n<pre class=\"nums:false lang:default decode:true\">pip install packagename<\/pre>\n<p>If both of the above options can&#8217;t find what you&#8217;re looking for, it&#8217;s still possible to install your desired package by downloading it directly from the developer and following their installation instructions whilst the your environment is activated.<\/p>\n<p>&nbsp;<\/p>\n<h6><span style=\"text-decoration: underline\">User Installation in Python Canopy 2.1 (not recommended, <span class=\"BNl2gb\">deprecated<\/span>)<br \/>\n<\/span><\/h6>\n<p>Before you begin, please note that at least 2GB of free space are required in your home directory for the Canopy Python user installation. It is not possible to install this in a different location. Home directories can easily fill up, causing various computing issues, so please be mindful of this when you choose to install your own Python environment.<\/p>\n<p>The following command installs your personal Python environment from the Canopy 2.1.8 distribution. You will only need to run this once and afterwards your personal environment will be automatically called when you load the &#8216;canopy2-userenv&#8217; module.<\/p>\n<pre class=\"nums:false lang:default decode:true\">\/share\/apps\/python\/python2.7\/canopy-2.1.8-userenv\/canopy<\/pre>\n<p>The installation will take quite a while and end with displaying the Canopy GUI. From here, you can install additional packages in the &#8216;Package Manager&#8217;. In order to use this feature, you&#8217;ll need to register with <a href=\"https:\/\/www.enthought.com\/\">Enthought<\/a>.<\/p>\n<p>From now on your own Python user environment can be simply loaded with:<\/p>\n<pre class=\"nums:false lang:default decode:true\">module load canopy2-userenv<\/pre>\n<p>If you don&#8217;t want to use the Canopy package manager to install packages, you can also use the native &#8216;edm&#8217; command instead.<\/p>\n<pre class=\"nums:false lang:default decode:true\">edm install packagename<\/pre>\n<p>If the package you require is not found via the &#8216;edm&#8217; command, you can also try using &#8216;pip&#8217;:<\/p>\n<pre class=\"nums:false lang:default decode:true\">pip install packagename<\/pre>\n<p>If both of the above options can&#8217;t find what you&#8217;re looking for, it&#8217;s still possible to install your desired package by downloading it directly from the developer and following their installation instructions whilst the canopy2-userenv module is loaded.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The recommended python distribution on\u00a0 the Reading Academic Computing Cluster (RACC) is Anaconda Individual Edition. It is installed centrally with the standard set op packages, and can be accessed with the &#8216;module&#8217; command. Anaconda provides a large collection of scientific packages, and not only python based ones. Those packages can be installed by users in<\/p>\n","protected":false},"author":316,"featured_media":1715,"template":"","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"__cvm_playback_settings":[],"__cvm_video_id":"","_links_to":"","_links_to_target":""},"kbe_taxonomy":[61,91],"kbe_tags":[],"class_list":["post-2432","kbe_knowledgebase","type-kbe_knowledgebase","status-publish","has-post-thumbnail","hentry","kbe_taxonomy-academic-cluster-articles","kbe_taxonomy-software"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python on the Academic Computing Cluster - Academic Computing Team<\/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:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python on the Academic Computing Cluster - Academic Computing Team\" \/>\n<meta property=\"og:description\" content=\"The recommended python distribution on\u00a0 the Reading Academic Computing Cluster (RACC) is Anaconda Individual Edition. It is installed centrally with the standard set op packages, and can be accessed with the &#039;module&#039; command. Anaconda provides a large collection of scientific packages, and not only python based ones. Those packages can be installed by users in\" \/>\n<meta property=\"og:url\" content=\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/\" \/>\n<meta property=\"og:site_name\" content=\"Academic Computing Team\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T13:29:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/icons\/python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/\",\"name\":\"Python on the Academic Computing Cluster - Academic Computing Team\",\"isPartOf\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#website\"},\"datePublished\":\"2018-11-28T14:37:31+00:00\",\"dateModified\":\"2024-07-24T13:29:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/research.reading.ac.uk\/act\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Knowledgebase\",\"item\":\"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python on the Academic Computing Cluster\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#website\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/\",\"name\":\"Academic Computing Team\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/research.reading.ac.uk\/act\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#organization\",\"name\":\"University of Reading\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png\",\"contentUrl\":\"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png\",\"width\":512,\"height\":512,\"caption\":\"University of Reading\"},\"image\":{\"@id\":\"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python on the Academic Computing Cluster - Academic Computing Team","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:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/","og_locale":"en_GB","og_type":"article","og_title":"Python on the Academic Computing Cluster - Academic Computing Team","og_description":"The recommended python distribution on\u00a0 the Reading Academic Computing Cluster (RACC) is Anaconda Individual Edition. It is installed centrally with the standard set op packages, and can be accessed with the 'module' command. Anaconda provides a large collection of scientific packages, and not only python based ones. Those packages can be installed by users in","og_url":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/","og_site_name":"Academic Computing Team","article_modified_time":"2024-07-24T13:29:45+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/icons\/python.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/","url":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/","name":"Python on the Academic Computing Cluster - Academic Computing Team","isPartOf":{"@id":"https:\/\/research.reading.ac.uk\/act\/#website"},"datePublished":"2018-11-28T14:37:31+00:00","dateModified":"2024-07-24T13:29:45+00:00","breadcrumb":{"@id":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/python-on-the-academic-computing-cluster\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/research.reading.ac.uk\/act\/"},{"@type":"ListItem","position":2,"name":"Knowledgebase","item":"https:\/\/research.reading.ac.uk\/act\/knowledgebase\/"},{"@type":"ListItem","position":3,"name":"Python on the Academic Computing Cluster"}]},{"@type":"WebSite","@id":"https:\/\/research.reading.ac.uk\/act\/#website","url":"https:\/\/research.reading.ac.uk\/act\/","name":"Academic Computing Team","description":"","publisher":{"@id":"https:\/\/research.reading.ac.uk\/act\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/research.reading.ac.uk\/act\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/research.reading.ac.uk\/act\/#organization","name":"University of Reading","url":"https:\/\/research.reading.ac.uk\/act\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/","url":"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png","contentUrl":"https:\/\/research.reading.ac.uk\/act\/wp-content\/uploads\/sites\/2\/2017\/08\/cropped-University_of_Reading_shield-1.png","width":512,"height":512,"caption":"University of Reading"},"image":{"@id":"https:\/\/research.reading.ac.uk\/act\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase\/2432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase"}],"about":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/types\/kbe_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/users\/316"}],"version-history":[{"count":8,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase\/2432\/revisions"}],"predecessor-version":[{"id":7652,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_knowledgebase\/2432\/revisions\/7652"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/media\/1715"}],"wp:attachment":[{"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/media?parent=2432"}],"wp:term":[{"taxonomy":"kbe_taxonomy","embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_taxonomy?post=2432"},{"taxonomy":"kbe_tags","embeddable":true,"href":"https:\/\/research.reading.ac.uk\/act\/wp-json\/wp\/v2\/kbe_tags?post=2432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}