{"id":148250,"date":"2023-10-16T11:35:30","date_gmt":"2023-10-16T15:35:30","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=148250"},"modified":"2024-04-22T21:13:55","modified_gmt":"2024-04-23T01:13:55","slug":"spyder","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/common-languages\/python\/python-editing\/spyder\/","title":{"rendered":"Spyder"},"content":{"rendered":"<p><a name=\"top\"><\/a><\/p>\n<div style=\"width:100%;\">\n<div style=\"float:right;width:49%;\"><img loading=\"lazy\" src=\"\/tech\/files\/2023\/12\/spyder-e1702917339894.png\" alt=\"\" width=\"600\" height=\"373\" class=\"alignnone size-full wp-image-149630\" \/><\/div>\n<div style=\"float:none;\">\n<h2>Spyder OnDemand Interactive App<\/h2>\n<p>This is our recommended way to use Python within <a href=\"https:\/\/www.spyder-ide.org\/\">Spyder<\/a> on the SCC. To launch Spyder from SCC OnDemand, you will need to start a Spyder Interactive App and load your preferred python environment (i.e. Python or Conda).<\/div>\n<p>&nbsp;<br \/>\n&nbsp;<\/p>\n<ol type=\"1\">\n<li>Open a browser and login to <a href=\"https:\/\/scc-ondemand.bu.edu\">https:\/\/scc-ondemand.bu.edu<\/a> with your BU credentials.<\/li>\n<li>Click <b>Interactive Apps<\/b> &gt; <b>Spyder<\/b>.<br \/>\n&nbsp;<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2023\/11\/spyder_interactive-575x636.png\" alt=\"\" width=\"575\" height=\"636\" class=\"alignnone size-medium wp-image-149158\" srcset=\"https:\/\/www.bu.edu\/tech\/files\/2023\/11\/spyder_interactive-575x636.png 575w, https:\/\/www.bu.edu\/tech\/files\/2023\/11\/spyder_interactive.png 665w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><\/li>\n<li>Specify in the the <b>Working Directory<\/b> field the directory for your files. The default is your home directory.<br \/>\n&nbsp;<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2023\/10\/work-1-636x110.png\" alt=\"\" width=\"636\" height=\"110\" class=\"alignnone size-medium wp-image-148349\" srcset=\"https:\/\/www.bu.edu\/tech\/files\/2023\/10\/work-1-636x110.png 636w, https:\/\/www.bu.edu\/tech\/files\/2023\/10\/work-1-768x133.png 768w, https:\/\/www.bu.edu\/tech\/files\/2023\/10\/work-1.png 772w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/><\/li>\n<li>Click one of the Python environment options below for further instructions within that package manager:<br \/>\n<!-- RADIO BUTTON TABLE --><\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><input name=\"manager\" id=\"python1\" onclick=\"show_manager('python')\" value=\"python\" type=\"radio\" \/><br \/>\n<strong><label for=\"python1\">Python<\/label><\/strong><\/td>\n<td style=\"text-align: center;\"><input name=\"manager\" id=\"virtualenv1\" onclick=\"show_manager('virtualenv')\" value=\"virtualenv\" type=\"radio\" \/><br \/>\n<strong><label for=\"virtualenv1\">Python: virtualenv<\/label><\/strong><\/td>\n<td style=\"text-align: center;\"><input name=\"manager\" id=\"conda1\" onclick=\"show_manager('conda')\" value=\"conda\" type=\"radio\" \/><br \/>\n<strong><label for=\"conda1\">Miniconda: conda env<\/label><\/strong><\/td>\n<td style=\"text-align: center;\"><input name=\"manager\" id=\"select1\" onclick=\"show_manager('select')\" value=\"select\" type=\"radio\" \/><br \/>\n<strong><label for=\"select1\">hide<\/label><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><!-- PYTHON CONTENTS --><\/p>\n<div id=\"python\">\n&nbsp;<\/p>\n<ol type=\"A\">\n<li>On the Spyder request page, specify the version of Python you need in the <b>List of modules to load (space separate)<\/b> field. This will setup environment variables to associate the proper resources for your session and set the python interpreter. Click Launch to submit the request.<br \/>\n&nbsp;<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2023\/11\/spyder_python-e1701214708604.png\" alt=\"\" width=\"588\" height=\"258\" class=\"alignnone size-full wp-image-149159\" \/><\/li>\n<p>&nbsp;<br \/>\n<script type=\"text\/javascript\">\r\ndocument.getElementById('python').style.display = 'none';\r\n<\/script>\n<\/p><\/div>\n<p><!-- VIRTUALENV CONTENTS --><\/p>\n<div id=\"virtualenv\">\n&nbsp;<\/p>\n<ol type=\"A\">\n<li>You will need to install <code><span class=\"command\">spyder<\/span><\/code> in your virtualenv for the kernel to be available in the IDE. This is done with the following:\n<pre><code class=\"code-block\"><span class=\"prompt\">[rcs@scc1 ~]<\/span> <span class=\"command\">source<\/span> <span class=\"placeholder\">\/projectnb\/yourprojectname\/venvs\/mynewenv<\/span>\/bin\/activate\r\n<span class=\"prompt\">(mynewenv) [rcs@scc1 ~]<\/span> <span class=\"command\">pip install spyder<\/span><\/code><\/pre>\n<\/li>\n<p>&nbsp;<\/p>\n<li>On the Spyder request page, specify the version of Python you need in the <b>List of modules to load (space separate)<\/b> field AND add the command to source your environment under the <b>Pre-Launch Commands field (optional)<\/b>. This will setup environment variables to associate the proper resources for your session and set the python interpreter. Click Launch to submit the request.<br \/>\n&nbsp;<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2023\/11\/spyder_venv-e1701214880949.png\" alt=\"\" width=\"585\" height=\"267\" class=\"alignnone size-full wp-image-149160\" \/><\/li>\n<p>&nbsp;<br \/>\n<script type=\"text\/javascript\">\r\ndocument.getElementById('virtualenv').style.display = 'none';\r\n<\/script>\n<\/p><\/div>\n<p><!-- CONDA CONTENTS --><\/p>\n<div id=\"conda\">\n&nbsp;<\/p>\n<ol type=\"A\">\n<li>You will need to install <code><span class=\"command\">spyder<\/span><\/code> in your conda environment for the kernel to be available in the IDE. This is done with the following:\n<pre><code class=\"code-block\"><span class=\"prompt\">[rcs@scc1 ~]<\/span> <span class=\"command\">conda activate my_conda_env<\/span>\r\n<span class=\"prompt\">(my_conda_env) [rcs@scc1 ~]<\/span> <span class=\"command\">pip install spyder<\/span><\/code><\/pre>\n<\/li>\n<p>&nbsp;<\/p>\n<li>On the Spyder request page, specify the version of Miniconda you need in the <b>List of modules to load (space separate)<\/b> field AND add the command to source your environment under the <b>Pre-Launch Commands field (optional)<\/b>. This will setup environment variables to associate the proper resources for your session and set the python interpreter. Click Launch to submit the request.<br \/>\n&nbsp;<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2023\/11\/spyder_conda_env-e1701216717449.png\" alt=\"\" width=\"586\" height=\"264\" class=\"alignnone size-full wp-image-149164\" \/><\/li>\n<p>&nbsp;<br \/>\n<script type=\"text\/javascript\">\r\ndocument.getElementById('conda').style.display = 'none';\r\n<\/script>\n<\/p><\/div>\n<p><!-- BACKTOTOP --><\/p>\n<div id=\"backtotop\"><a href=\"#top\">Back to top<\/a><\/div>\n<\/li>\n<\/ol>\n<p><!-- JAVASCRIPT --><\/p>\n<p><script type=\"text\/javascript\">\r\nfunction show_manager(manager){    \r\nif (manager == \"python\"){\r\n \t   document.getElementById('python').style.display = 'block';\r\n \t   document.getElementById('virtualenv').style.display = 'none';\r\n \t   document.getElementById('conda').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n  \t} \r\nelse if (manager == \"virtualenv\"){\r\n \t   document.getElementById('python').style.display = 'none';\r\n \t   document.getElementById('virtualenv').style.display = 'block';\r\n \t   document.getElementById('conda').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n  \t} \r\nelse if (manager == \"conda\"){\r\n \t   document.getElementById('python').style.display = 'none';\r\n \t   document.getElementById('virtualenv').style.display = 'none';\r\n \t   document.getElementById('conda').style.display = 'block';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n         }    \r\nelse {\r\n \t   document.getElementById('python').style.display = 'none';\r\n \t   document.getElementById('virtualenv').style.display = 'none';\r\n \t   document.getElementById('conda').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n     }\r\n }\r\n<\/script><br \/>\n<!-- END CODE SERVER SECTION --><\/p>\n<div style=\"float: right;\">\n<p id=\"last-modified-timestamp\" style=\"margin: 0;\">Last updated: Loading&#8230;<\/p>\n<\/div>\n<p><script>\r\ndocument.addEventListener('DOMContentLoaded', function() {\r\n    \/\/ Get the content of the meta tag\r\n    var lastUpdatedContent = document.querySelector('meta[name=\"last-updated\"]').content;\r\n    \r\n    \/\/ Parse the content into a Date object\r\n    var lastUpdatedDate = new Date(lastUpdatedContent);\r\n    \r\n    \/\/ Format the date\r\n    var formattedDate = lastUpdatedDate.toLocaleDateString(undefined, { year: 'numeric', month: 'long', day: 'numeric' });\r\n    \r\n    \/\/ Update the HTML element with the formatted date\r\n    document.getElementById('last-modified-timestamp').innerHTML = 'Last updated: ' + formattedDate;\r\n});\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spyder OnDemand Interactive App This is our recommended way to use Python within Spyder on the SCC. To launch Spyder from SCC OnDemand, you will need to start a Spyder Interactive App and load your preferred python environment (i.e. Python or Conda). &nbsp; &nbsp; Open a browser and login to https:\/\/scc-ondemand.bu.edu with your BU credentials&#8230;.<\/p>\n","protected":false},"author":1692,"featured_media":0,"parent":147624,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/148250"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1692"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=148250"}],"version-history":[{"count":18,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/148250\/revisions"}],"predecessor-version":[{"id":154142,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/148250\/revisions\/154142"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/147624"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=148250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}