{"id":362,"date":"2014-02-08T13:19:48","date_gmt":"2014-02-08T12:19:48","guid":{"rendered":"http:\/\/www.timokorthals.de\/?p=362"},"modified":"2016-12-28T00:13:24","modified_gmt":"2016-12-27T23:13:24","slug":"running-remote-notebook-on-a-remote-outdated-debian-server","status":"publish","type":"post","link":"https:\/\/www.timokorthals.de\/?p=362","title":{"rendered":"Running ipython notebook on a remote (outdated) ubuntu system"},"content":{"rendered":"<p><em>Note: Jump to the end of this post to install a basic ipython-notebook environment.<\/em><\/p>\n<p><a title=\"nb\" href=\"http:\/\/ipython.org\/notebook.html\" target=\"_blank\">ipython notebook<\/a> is one of the most impressive things I&#8217;ve seen the last few years.\u00a0You can reache outstanding results wich are documented and calculated on the same page.\u00a0So no more paper war and mixed solutions for my problems anymore ;).<!--more--><\/p>\n<p>But while I get more and more different systems\/computers and laptops, it&#8217;s hard to keep track of a consistent notebook.\u00a0One could say: Use <em>git <\/em>or <em>subversion<\/em>.\u00a0But then it comes to the point where you want to show some other guys your results in the bus and you want to change some variables, or add some new ideas (Assuming that you have internet everywhere nowadays).\u00a0At that point even the <a title=\"nb-viewer\" href=\"http:\/\/nbviewer.ipython.org\/\" target=\"_blank\">notebook-viewer<\/a> in combination with <em>git <\/em> becomes (more or less) futile.<\/p>\n<p><strong>So what do we want:<\/strong><\/p>\n<ol>\n<li>An remote ipython notebook with\u00a0up-to-date packages<\/li>\n<li>Secured from the rest of the world<\/li>\n<li>A secured write\/execute-mode<\/li>\n<li>A read-only mode (so that we can distribute our achivements to privileged poeple)<\/li>\n<li>git (optional and not discussed here)<\/li>\n<\/ol>\n<p><strong>What do we have: <em>A remote server running Debian, with a stable but non up-to-date repository.<\/em><\/strong><\/p>\n<p>While the points <strong>2.-4.<\/strong> can be solved using<a href=\"http:\/\/ipython.readthedocs.org\/en\/master\/interactive\/public_server.html\" target=\"_blank\"> this solution<\/a>, the remote server becomes a problem, due to the fact that it has mostly a very stable but very outdated package repository. This leads to ugly outdated or non existing packages. In my case even the standard<a href=\"http:\/\/ipython.org\/install.html\" target=\"_blank\"> install routine<\/a>\u00a0from the ipython webpage did not work:<\/p>\n<pre class=\"lang:sh decode:true\" title=\"Standard packages for ipython\">sudo apt-get install ipython-notebook python-matplotlib \\\r\n                     python-scipy python-pandas python-sympy python-nose<\/pre>\n<p>In this case, you have to use <a href=\"http:\/\/wiki.ubuntuusers.de\/pip\" target=\"_blank\">pip<\/a>, which downloads the current packages from <a href=\"https:\/\/pypi.python.org\/pypi\" target=\"_blank\">PyPI<\/a> and compiles them for your system. As you can imagine, you need a bunch of dev packages. So here comes the solution at a glance:<\/p>\n<pre class=\"lang:sh decode:true\" title=\"Installation of ipython notebook\"># First we need some python and pip\r\napt-get install python python-pip \r\n# Now lets install some necessary dependencies for installing with pip\r\napt-get install python-dev.all libfreetype6 libfreetype6-dev \\\r\n                libpng12-dev gfortran libblas-dev liblapack-dev \\\r\n                pandoc\r\n# Finaly, lets get the newest packages\r\npip install ipython\r\npip install matplotlib\r\npip install pyzmq\r\npip install jinja2\r\npip install scipy\r\npip install pandas\r\npip install sympy\r\npip install nose\r\npip install pygments  # For html conversion\r\npip install sphinx    # For latex conversion\r\nipython notebook # Running the notebook\r\n<\/pre>\n<p>A nice conversion from notebook to a PDF document:<\/p>\n<pre class=\"lang:sh decode:true\" title=\"nb conversion\">ipython nbconvert MyNotebook.ipynb --SphinxTransformer.author=\"The Author\" --to latex --post PDF<\/pre>\n<p><strong># Update [2014-04-15]<\/strong><\/p>\n<p>The new version of ipython was released: ipython 2.0.0 which needs python &gt; 2.6. So you cannot use pip together with PyPi for installing\/upgrading ipython 1.* anymore, if your system still runs python 2.6 or older.<\/p>\n<p>The workaround is as follows:<br \/>\nGrep the newest 1.* release from the ipython <a title=\"archive\" href=\"http:\/\/archive.ipython.org\/release\/\">archive<\/a><br \/>\nThen install the version (here 1.2.1) you need with pip explicitly:<\/p>\n<pre class=\"lang:sh decode:true\" title=\"Install ipython from website\">pip install --upgrade http:\/\/archive.ipython.org\/release\/1.2.1\/ipython-1.2.1.tar.gz\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Note: Jump to the end of this post to install a basic ipython-notebook environment. ipython notebook is one of the most impressive things I&#8217;ve seen the last few years.\u00a0You can reache outstanding results wich are documented and calculated on the same page.\u00a0So no more paper war and mixed solutions for my problems anymore ;).<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,3,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=\/wp\/v2\/posts\/362"}],"collection":[{"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=362"}],"version-history":[{"count":1,"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":402,"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions\/402"}],"wp:attachment":[{"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.timokorthals.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}