Py2exe with Tkinter

时间秒杀一切 提交于 2019-12-01 06:46:46

For your original problem I can't say what exactly the problem is, but usually it helps with trial-and-error to guess missing files and directories. If you know what you're missing, add them to your packages (for python modules) or data_files (for other files).

The second problem is the result of some c-modules (and python itself) being build with MS Visual Studio, thus having a dependency to the MS Visual C++ 9.0 (2008) runtime. You can solve this by either:

  • owning a copy of Visual Studio (Express Edition doesn't count), so that you are permitted to redistribute the MSVCR dependencies (under the condition that you forbid your users reengeneering etc. of the dependend parts)

  • pointing your users to the download of the MS Visual C++ 2008 Redistributable package at Microsoft.

I found a bug on the virutalenv site which suggested the following https://github.com/pypa/virtualenv/issues/93

for windows in your directory "C:\Environments\VirtualEnv\Scripts\activate.bat" just add which are set to the right path to TCL and TK for your python version

set "TCL_LIBRARY=C:\Python27\tcl\tcl8.5"
set "TK_LIBRARY=C:\Python27\tcl\tk8.5"

and restart your cmd or shell

It worked very well for me when I had this error.

py2exe doesn't work with modules, i've heard of one called c_freeze which apparently works with modules, try that? http://cx-freeze.sourceforge.net/

charo

With respect to MSVCR90.dll, see this post which packages it and maybe less preferable than having user install it separately.

Also, the specific issue in that post was mine and i still don't understand root cause. That said, a complete uninstall python and clean rebuild worked great... maybe that is your issue too. py2exe gives RuntimeError: Too early to create image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!