python3.7.0怎么运行代码_python3代码打包成mac的程序,没办法运行,各位大神请指导一下...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

python3代码打包成mac的程序,没办法运行,打包的时候没有出错,请高手知道的说一下,我是一个小白,

这是出错的提示:

Last login: Sat Nov 23 10:09:36 on ttys004

zhanghong@192 ~ % /Users/zhanghong/PycharmProjects/untitled1/dist/b ; exit;

Traceback (most recent call last):

File "PyInstaller/loader/rthooks/pyi_rth__tkinter.py", line 28, in

FileNotFoundError: Tcl data directory "/var/folders/4p/xy0j475966zb4ns90f6mfq2c0000gn/T/_MEIGnK4AM/tcl" not found.

[1947] Failed to execute script pyi_rth__tkinter

[进程已完成]

我的代码很简单,代码是:

import tkinter

top = tkinter.Tk()

# 进入消息循环

top.mainloop()

代码打包的过程,如下:

(venv) zhanghong@192 untitled1 % pyinstaller -F b.py

71 INFO: PyInstaller: 3.5

71 INFO: Python: 3.7.2

83 INFO: Platform: Darwin-19.0.0-x86_64-i386-64bit

85 INFO: wrote /Users/zhanghong/PycharmProjects/untitled1/b.spec

88 INFO: UPX is not available.

90 INFO: Extending PYTHONPATH with paths

['/Users/zhanghong/PycharmProjects/untitled1',

'/Users/zhanghong/PycharmProjects/untitled1']

90 INFO: checking Analysis

91 INFO: Building Analysis because Analysis-00.toc is non existent

91 INFO: Initializing module dependency graph...

93 INFO: Initializing module graph hooks...

94 INFO: Analyzing base_library.zip ...

4349 INFO: running Analysis Analysis-00.toc

4361 INFO: Caching module hooks...

4368 INFO: Analyzing /Users/zhanghong/PycharmProjects/untitled1/b.py

4540 INFO: Loading module hooks...

4540 INFO: Loading module hook "hook-_tkinter.py"...

4543 ERROR: Tcl/Tk improperly installed on this system.

4544 INFO: Loading module hook "hook-encodings.py"...

4626 INFO: Loading module hook "hook-xml.py"...

4967 INFO: Loading module hook "hook-pydoc.py"...

4991 INFO: Looking for ctypes DLLs

4992 INFO: Analyzing run-time hooks ...

4996 INFO: Including run-time hook 'pyi_rth__tkinter.py'

5003 INFO: Looking for dynamic libraries

5136 INFO: Looking for eggs

5136 INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.7/Python

5140 INFO: Warnings written to /Users/zhanghong/PycharmProjects/untitled1/build/b/warn-b.txt

5188 INFO: Graph cross-reference written to /Users/zhanghong/PycharmProjects/untitled1/build/b/xref-b.html

5206 INFO: checking PYZ

5206 INFO: Building PYZ because PYZ-00.toc is non existent

5206 INFO: Building PYZ (ZlibArchive) /Users/zhanghong/PycharmProjects/untitled1/build/b/PYZ-00.pyz

5734 INFO: Building PYZ (ZlibArchive) /Users/zhanghong/PycharmProjects/untitled1/build/b/PYZ-00.pyz completed successfully.

5744 INFO: checking PKG

5744 INFO: Building PKG because PKG-00.toc is non existent

5744 INFO: Building PKG (CArchive) PKG-00.pkg

9131 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

9136 INFO: Bootloader /Users/zhanghong/PycharmProjects/untitled1/venv/lib/python3.7/site-packages/PyInstaller/bootloader/Darwin-64bit/run

9136 INFO: checking EXE

9136 INFO: Building EXE because EXE-00.toc is non existent

9136 INFO: Building EXE from EXE-00.toc

9136 INFO: Appending archive to EXE /Users/zhanghong/PycharmProjects/untitled1/dist/b

9151 INFO: Fixing EXE for code signing /Users/zhanghong/PycharmProjects/untitled1/dist/b

9162 INFO: Building EXE from EXE-00.toc completed successfully.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值