[IPython-user] Embedding IPython with py2exe

Fernando Perez Fernando.Perez at colorado.edu
Fri Dec 31 16:35:30 CST 2004


Michael Foord wrote:

>>>Nice and easy !! Except when called from a py2exe program, site.py isn't
>>>imported. This means that 'copyright' and 'credits' aren't available as
>>>builtins. This causes part of IPython to fail. To rectify this I used
>>>the following code straight from site.py :
>>
>>
>>[...]
>>
>>
>>>This solves the problem neatly. I've also posted this message to the
>>>py2exe mailing list as well. It could also be fixed by testing for
>>>NameError when they are used in IPython... but that may not be a 
>>>priority.
>>
>>
>>Well, I'm not exactly sure what your question is here.  Would you 
>>prefer ipython to perform this kind of check, or are you happy with 
>>your current solution?  I don't have a problem with adding such a 
>>check, esp. because other embedded users may run into the exact same 
>>problem down the road.  I tend to avoid too many special-purpose 
>>checks, but this one seems to provide wide benefit, and as I'm 
>>starting to work on the internal cleanup for GUI embedding, this may 
>>well become necessary.
> 
> 
> 
> Both. I'm quite happy with my current fix. *But* for the sake of others 
> who may want to embed IPython and use py2exe it would be wise to fix it 
> so this is generally possible.

OK, thanks for clarifying.  I'll add a check for this in a future release 
then, but for now keep your fix in, since it may be a while on my side.

Cheers,

f




More information about the IPython-user mailing list