py2exe - generate single executable file

前端 未结 9 834
野的像风
野的像风 2020-11-22 01:45

I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line optio

9条回答
  •  旧巷少年郎
    2020-11-22 02:08

    You should create an installer, as mentioned before. Even though it is also possible to let py2exe bundle everything into a single executable, by setting bundle_files option to 1 and the zipfile keyword argument to None, I don't recommend this for PyGTK applications.

    That's because of GTK+ tries to load its data files (locals, themes, etc.) from the directory it was loaded from. So you have to make sure that the directory of your executable contains also the libraries used by GTK+ and the directories lib, share and etc from your installation of GTK+. Otherwise you will get problems running your application on a machine where GTK+ is not installed system-wide.

    For more details read my guide to py2exe for PyGTK applications. It also explains how to bundle everything, but GTK+.

提交回复
热议问题