捆绑时 Py2exe 缺少模块 [英] Py2exe missing modules when bundling

查看:46
本文介绍了捆绑时 Py2exe 缺少模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我开始之前,我已经检查了这个问题并且我已经有了一个windows=[] 在我的 setup.py 中.请注意,我将要转换的脚本命名为 Tkinter.py.

Before I start, I've checked out this question and I already have a windows=[] in my setup.py. Note that I named the script I want to convert Tkinter.py.

这是我的 setup.py:

Here's my setup.py:

from distutils.core import setup
import py2exe

setup(
    windows=['Tkinter.py'],
    options={
        "py2exe":{
            "bundle_files":1,

        }
    }
)

这里是错误:

C:\Users\Julian\Desktop\Tkinter>python setup.py py2exe
running py2exe

  3 missing Modules
  ------------------
? readline                            imported from cmd, code, pdb
? win32api                            imported from platform
? win32con                            imported from platform
The following modules require a minimum bundle_files option,
otherwise they will not work (currently bundle_files is set to 1):
    tkinter: 2

Please change the bundle_files option and run the build again.
Build failed.

我正在尝试将其全部捆绑到一个 exe 文件中.感谢您的帮助!

I'm trying to bundle it all down to one exe file. I appreciate the help!

推荐答案

请忽略缺少模块的问题.他们不会造成任何问题.对于捆绑问题,只需将捆绑值更改为 2 即可.

Just ignore the missing modules issue. They wont cause any problems. For the Bundling issue, just changing the bundle value to 2 worked for me.

这篇关于捆绑时 Py2exe 缺少模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆