鱼C论坛

 找回密码
 立即注册
查看: 1697|回复: 1

Python3.6.3通过Pyinstaller打包程序失败求解!

[复制链接]
发表于 2017-12-31 17:36:11 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
如题,各位大大,求帮忙!
环境:Win7 64bit、Python 3.6.3-32bit、Pyinstaller3.3.1(这个版本是支持Python3.6的吧)

情况是这样的:
        首先,我只写了一个print语句,没有import任何东西,运行正常,打包成的exe也正常运行;
        然后,又写了一个简单的UI界面,import tkinter,又加了一个按钮,界面如下:
2017-12-31_171226.jpg
  1. import tkinter

  2. app=tkinter.Tk()
  3. tkinter.Button(app,text='点点点').pack()

  4. app.mainloop()
复制代码
这个.py文件运行正常,用pyinstaller打包生成exe的过程也没报错,但是打开exe的时候报错了(Failed to execute script tkinter_form):
2017-12-31_171930.jpg

调试发现有ImportError内存位置访问无效,接下来就不知道怎么解决了,一直找不到有效的方法。。。
2017-12-31_151907.jpg
build下生成的warntkinter_form.txt内容如下(不知道怎么会有这么多missing项):
  1. missing module named resource - imported by posix, E:\MyPython\packeg_hello\tkinter_form.py
  2. missing module named posix - imported by os, E:\MyPython\packeg_hello\tkinter_form.py
  3. missing module named _posixsubprocess - imported by subprocess, E:\MyPython\packeg_hello\tkinter_form.py
  4. missing module named 'org.python' - imported by pickle, E:\MyPython\packeg_hello\tkinter_form.py, xml.sax
  5. missing module named readline - imported by cmd, code, pdb, E:\MyPython\packeg_hello\tkinter_form.py
  6. excluded module named _frozen_importlib - imported by importlib, importlib.abc, E:\MyPython\packeg_hello\tkinter_form.py
  7. missing module named _frozen_importlib_external - imported by importlib._bootstrap, importlib, importlib.abc, E:\MyPython\packeg_hello\tkinter_form.py
  8. missing module named _winreg - imported by platform, E:\MyPython\packeg_hello\tkinter_form.py
  9. missing module named _scproxy - imported by urllib.request
  10. missing module named java - imported by platform, E:\MyPython\packeg_hello\tkinter_form.py
  11. missing module named 'java.lang' - imported by platform, E:\MyPython\packeg_hello\tkinter_form.py, xml.sax._exceptions
  12. missing module named vms_lib - imported by platform, E:\MyPython\packeg_hello\tkinter_form.py
  13. missing module named termios - imported by tty, E:\MyPython\packeg_hello\tkinter_form.py, getpass
  14. missing module named grp - imported by shutil, tarfile, E:\MyPython\packeg_hello\tkinter_form.py
  15. missing module named pwd - imported by posixpath, shutil, tarfile, http.server, webbrowser, E:\MyPython\packeg_hello\tkinter_form.py, netrc, getpass
  16. missing module named _dummy_threading - imported by dummy_threading, E:\MyPython\packeg_hello\tkinter_form.py
  17. missing module named org - imported by copy, E:\MyPython\packeg_hello\tkinter_form.py
复制代码


各位大大,求帮忙!
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2018-1-2 10:41:56 | 显示全部楼层
版主大大呢?出来帮忙解决问题啊
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-12-26 21:39

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表