Difference between revisions of "Slicer3:Python:ipython"

From Slicer Wiki
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Install ipython
+
==Install ipython==
  
 
<pre>
 
<pre>
cd Slicer3-lib
+
cd ../Slicer3-lib
 
wget http://ipython.scipy.org/dist/ipython-0.10.tar.gz
 
wget http://ipython.scipy.org/dist/ipython-0.10.tar.gz
 
tar xvfz ipython-0.10.tar.gz
 
tar xvfz ipython-0.10.tar.gz
Line 11: Line 11:
 
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.
 
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:
+
==Hints==
To use the %edit magic function with tk ipython:
+
* To use the %edit magic function with tk ipython:
 
  __IPYTHON__.rc.editor = 'xterm -e vi'
 
  __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 [http://na-mic.org/Mantis/view.php?id=985 bug 985]).  In this case, a newer version of ipython may help (see [https://github.com/ipython/ipython/issues/154]).

Latest revision as of 10:51, 18 March 2011

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]).