Hi,

Can you provide me with a setup.py script and a small script that you
are attempting to freeze that is causing the problem? The correct
syntax should be excludes = ["Tkinter"] but it might be helpful to
know what is causing the import and if that can be prevented by simply
excluding the module.

The code you reference is for module specific exclusions. Ordinarily
that dictionary is empty but if you look at hooks.py you will find
plenty of places where module.ExcludeName() is called. The excludes
themselves are simply put into the list of modules found by the finder
with a value of None. There are ways of forcing the value back in --
which is another reason why I'd like to know what is causing the
import in the first place to see if a hook is causing it. If that is
the case I'll find some way of forcing it to __stay__ excluded. :-)

Anthony

On Mon, Mar 30, 2009 at 4:20 PM, Tony Meyer <[email protected]> wrote:
> Hi,
>
> I'm having some trouble using cx_Freeze 4.0.1 and excluding Tkinter
> (which is not installed).  I've tried:
>  * adding excludes=["Tkinter"] to the Executable arg
>  * adding excludes="Tkinter" to the Executable arg
>  * adding excludes=["Tkinter"] to the setup call
>  * adding excludes="Tkinter" to the setup call
>  * adding "-e Tkinter" to the command line call
>
> None of these seem to have any effect.  I always end up with a
> traceback that ends with:
>
>  File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 41, in <module>
>   raise ImportError, str(msg) + ', please install the python-tk package'
> ImportError: No module named _tkinter, please install the python-tk package
>
> I took a look at the code, and I'm puzzled as to how this is meant to
> work.  In _ScanCode in cx_Freeze/finder.py there is the line:
>
>               if name not in module.excludeNames:
>
> Here 'name' is "Tkinter" at the point of the traceback, as expected.
> However, module.excludeNames is always an empty dictionary.  From what
> I can see, it will always be an empty dictionary, because when the
> module object is created, no excludes are passed to it, and
> module.excludeName() is never called.
>
> If someone could explain where I'm going wrong, that would be great,
> thanks!  Please let me know if more information is required.
>
> Thanks,
> Tony Meyer
>
> ------------------------------------------------------------------------------
> _______________________________________________
> cx-freeze-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>

------------------------------------------------------------------------------
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to