Slicer3:Python:ipython

From SlicerWiki
Jump to: navigation, search
Home < Slicer3:Python:ipython

Install ipython

cd ../Slicer3-lib
wget http://ipython.scipy.org/dist/ipython-0.10.tar.gz
tar xvfz ipython-0.10.tar.gz
cd ipython-0.10
../../Slicer3-build/Slicer3 --launch ../python-build/bin/python setup.py install

Just a note (inorton): I had a small issue with installation due to md5 import error during setup.py. It looks like stemming from different openssl versions on the Slicer build host machine (this was installing in 3.4 binary distribution for linux). Anyway, got around it by commenting out "import md5" in the offensive utility library: ".../ipython-0.9.1/IPython/external/path.py" md5 is only used in one service routine -- which is not called anywhere else. So should not be a problem, and works fine so far.

Hints

  • To use the %edit magic function with tk ipython:
__IPYTHON__.rc.editor = 'xterm -e vi'
  • (as of October 16, 2009) Tab completion will match slicer MRML node ID and MRML node Names. A dictionary Slicer.slicer.MRML (indexed by node Name) can be used to access nodes easily.
  • syntax coloring requires gnu readline support and no general method has yet been discovered for correctly installing this on macs.

Issues

In some cases the HOME environment variable may be undefined in the ipython shell (see bug 985). In this case, a newer version of ipython may help (see [1]).