Intra-package C extensions with

Pascal Chambon chambon.pascal at
Wed Jan 13 20:52:55 CET 2010

Hello everyone
Some times ago, I've had unexpected problems while trying to freeze some 
scripts into a standalone executable with the "" script.
I had already done it : normally, you simply freeze pure python modules 
into a standalone executable, you package it along with python 
extensions (, etc.), and you're done.

But the problem is that I had a dependency with python-fuse bindings, 
and these bindings contains a python extension ( inside 
the "fuseparts" package.
So pure python modules of this fuse wrapper got frozen into the 
standalone executable, and I had that "fuseparts/" left 
outside, which was not found by the module loader, since it was expected 
to appear inside a "fuseparts package" now embedded into the executable....

I've managed to solve that by manually "monkey patching" sys.modules, 
before fusemodule's actual import. But this looks like an unsatisfying 
solution, to me.
Does anyone have a clue about how to freeze a python program cleanly, in 
case such inner C extensions are involved ? Does any of the freezers 
(, py2exe, pyrex, cx_freeze...) do that ? I haven't seen such 
things so far in their docs.

Thanks for the attention,

More information about the Python-list mailing list