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’ve seen the last few years. You can reache outstanding results wich are documented and calculated on the same page. So no more paper war and mixed solutions for my problems anymore ;).
But while I get more and more different systems/computers and laptops, it’s hard to keep track of a consistent notebook. One could say: Use git or subversion. But 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). At that point even the notebook-viewer in combination with git becomes (more or less) futile.
So what do we want:
- An remote ipython notebook with up-to-date packages
- Secured from the rest of the world
- A secured write/execute-mode
- A read-only mode (so that we can distribute our achivements to privileged poeple)
- git (optionaly and not discussed here)
What do we have: A remote server running Debian, with a non up-to-date repository.
While the points 2.-4. can be solved using this solution, 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 install routine from the ipython webpage did not work:
sudo apt-get install ipython-notebook python-matplotlib \
python-scipy python-pandas python-sympy python-nose
In this case, you have to use pip, which downloads the current packages from PyPI 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:
# First we need some python and pip
apt-get install python python-pip
# Now lets install some necessary dependencies for installing with pip
apt-get install python-dev.all libfreetype6 libfreetype6-dev \
libpng12-dev gfortran libblas-dev liblapack-dev \
# Finaly, lets get the newest packages
pip install ipython
pip install matplotlib
pip install pyzmq
pip install jinja2
pip install scipy
pip install pandas
pip install sympy
pip install nose
pip install pygments # For html conversion
pip install sphinx # For latex conversion
<span style="font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 12px; font-style: normal; line-height: 1.5;"># Running the notebook
A nice conversion from notebook to a PDF document:
ipython nbconvert MyNotebook.ipynb --SphinxTransformer.author="The Author" --to latex --post PDF