[IPython-dev] IPython and Freeze

Christopher Hart hart at caltech.edu
Mon Aug 4 03:50:49 EDT 2003


Hi,  

I've been happily using IPython for quite a while now and I and
collaborators have written quite a bit of code in the form of a python
API that is most useful when used interactively from the python
interpretor - and naturally IPython makes this even better.  

I thought a clever way of distributing this tool set to other folks
might be through freeze which turns a python script into a single
all-included binary executable (albiet a little bloated, quite easy to
distribute).

Has anyone successfully used freeze and IPython?  

Below is a minimal IPython program to freeze 

---begin ipy.py---

#!/usr/bin/env python

"""
A simple test program to build a stand-alone version of IPython
"""

from IPython.Shell import IPythonShellEmbed 
ipshell = IPythonShellEmbed()

def main():
  ipshell()  

if __name__ == "__main__":
    main()
    
---end ipy.py---

Here is how I attempted to freeze it and what errors I get:

$ freeze.py -o ipy ipy.py
$ cd ipy
$ make
$ ./ipy 
Traceback (most recent call last):
  File "ipy.py", line 7, in ?
  File "/usr/lib/python2.2/site-packages/IPython/__init__.py", line 37, in ?
    __import__(name,globals(),locals(),[])
  File "/usr/lib/python2.2/site-packages/IPython/genutils.py", line 34, in ?
    import types,commands,time,sys,os,re,shutil
ImportError: /usr/lib/python2.2/lib-dynload/time.so: undefined symbol: PyExc_IOError

Seems to be not freezeing everything it's supposed to.

thanks,
  chris

-------------------
Christopher Hart
Caltech Biology
  



More information about the IPython-dev mailing list