【解决】MacOS下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter
Fix tcl/tk libs inclusion in tkinter with Python3.7 under MacOS
使用 Pyinstaller 打包时候报错
3027 ERROR: Tcl/Tk improperly installed on this system.
(lyj_venv) ➜ liyongjiandeMBP.lan [/Users/liyongjian/lyj] pyinstaller --windowed --onefile --clean --noconfirm ServenDigitsDrawV2.py
INFO: PyInstaller: 3.4
INFO: Python: 3.7.
INFO: Platform: Darwin-18.5.-x86_64-i386-64bit
INFO: wrote /Users/liyongjian/lyj/ServenDigitsDrawV2.spec
INFO: UPX is not available.
INFO: Removing temporary files and cleaning cache in /Users/liyongjian/Library/Application Support/pyinstaller
INFO: Extending PYTHONPATH with paths
['/Users/liyongjian/lyj', '/Users/liyongjian/lyj']
INFO: checking Analysis
INFO: Building Analysis because Analysis-.toc is non existent
INFO: Initializing module dependency graph...
INFO: Initializing module graph hooks...
INFO: Analyzing base_library.zip ...
INFO: running Analysis Analysis-.toc
INFO: Caching module hooks...
INFO: Analyzing /Users/liyongjian/lyj/ServenDigitsDrawV2.py
INFO: Loading module hooks...
INFO: Loading module hook "hook-_tkinter.py"...
ERROR: Tcl/Tk improperly installed on this system.
INFO: Loading module hook "hook-encodings.py"...
INFO: Loading module hook "hook-xml.py"...
INFO: Loading module hook "hook-pydoc.py"...
INFO: Looking for ctypes DLLs
INFO: Analyzing run-time hooks ...
INFO: Including run-time hook 'pyi_rth__tkinter.py'
INFO: Looking for dynamic libraries
INFO: Looking for eggs
INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.7/Python
INFO: Warnings written to /Users/liyongjian/lyj/build/ServenDigitsDrawV2/warn-ServenDigitsDrawV2.txt
INFO: Graph cross-reference written to /Users/liyongjian/lyj/build/ServenDigitsDrawV2/xref-ServenDigitsDrawV2.html
INFO: checking PYZ
INFO: Building PYZ because PYZ-.toc is non existent
INFO: Building PYZ (ZlibArchive) /Users/liyongjian/lyj/build/ServenDigitsDrawV2/PYZ-.pyz
INFO: Building PYZ (ZlibArchive) /Users/liyongjian/lyj/build/ServenDigitsDrawV2/PYZ-.pyz completed successfully.
INFO: checking PKG
INFO: Building PKG because PKG-.toc is non existent
INFO: Building PKG (CArchive) PKG-.pkg
INFO: Building PKG (CArchive) PKG-.pkg completed successfully.
INFO: Bootloader /Users/liyongjian/lyj/lyj_venv/lib/python3./site-packages/PyInstaller/bootloader/Darwin-64bit/runw
INFO: checking EXE
INFO: Building EXE because EXE-.toc is non existent
INFO: Building EXE from EXE-.toc
INFO: Appending archive to EXE /Users/liyongjian/lyj/dist/ServenDigitsDrawV2
INFO: Fixing EXE for code signing /Users/liyongjian/lyj/dist/ServenDigitsDrawV2
INFO: Building EXE from EXE-.toc completed successfully.
INFO: checking BUNDLE
INFO: Building BUNDLE because BUNDLE-.toc is non existent
INFO: Building BUNDLE BUNDLE-.toc
INFO: moving BUNDLE data files to Resource directory
执行的时候报错
➜ liyongjiandeMBP.lan [/Users/liyongjian] /Users/liyongjian/lyj/dist/ServenDigitsDrawV2 ; exit;
Traceback (most recent call last):
File "PyInstaller/loader/rthooks/pyi_rth__tkinter.py", line , in <module>
FileNotFoundError: Tcl data directory "/var/folders/f9/6m090zhs6w55rmbmhkmpff440000gn/T/_MEITVlJln/tcl" not found.
[] Failed to execute script pyi_rth__tkinter [进程已完成]
解决办法:
在文件中增加
and 'Python' not in path_to_tcl
PyInstaller/hooks/hook-_tkinter.py
@@ -, +, @@ def _find_tcl_tk(hook_api): # _tkinter depends on Tcl/Tk compiled as frameworks.
path_to_tcl = bins[][]
- if 'Library/Frameworks' in path_to_tcl:
+ if 'Library/Frameworks' in path_to_tcl and 'Python' not in path_to_tcl:
参考链接:https://github.com/pyinstaller/pyinstaller/pull/3830
https://stackoverflow.com/questions/51847801/pyinstaller-app-not-opening-on-mac
【解决】MacOS下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter的更多相关文章
- moviepy应用pyinstaller打包后执行报错AttributeError: module audio/video.fx.all has no attribute fadein、crop
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 在开发moviepy的Python程序使用pyinstaller打包后 ...
- 【Python】pyinstaller打包运行报错failed to execute script main
前言 最近用pyinstaller打包的时候一直报"failed to execute script main". 最终使用"pyinstaller --hidden-i ...
- Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案
最近用PyQt5写了一个界面小程序,需要打包成exe给到其他windows上使用,一开始使用python 3.7 64位,用pyinstaller打包exe,在64位机上运行正常. 但是目标电脑是32 ...
- vue 使用webpack打包后路径报错以及 alias 的使用
一.vue 使用webpack打包后路径报错(两步解决) 1. config文件夹 ==> index.js ==> 把assetsPublicPath的 '/ '改为 './' 2. b ...
- 解决Pyqt打包后运行报错:应用程序无法启动 因为程序的并行配置不正确
做了一个生成二维码的小程序:http://www.cnblogs.com/dcb3688/p/4241048.html 直接运行脚本没问题,用pyinstaller打包后再运行就直接报错了: 应用程序 ...
- 【Python】解决使用pyinstaller打包Tkinker程序报错问题
问题描述 使用pyinstaller打包使用Tkinter编写的控制台程序,出现报错 15793 INFO: Adding Microsoft.Windows.Common-Controls to d ...
- vue项目打包后运行报错400如何解决
昨天一个Vue项目打包后,今天测试,发现无论localhost还是服务器上都运行不了,报错如下: Failed to load resource: the server responded with ...
- 【spring cloud】在spring cloud服务中,打包ms-core失败,报错Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:repackage (default) on project
在spring cloud服务中,有一个ms-code项目,只为所有的微服务提供核心依赖和工具类,没有业务意义,作为核心依赖使用.所以没有main方法,没有启动类. 在spring cloud整体打包 ...
- vue打包后接口报错
最近自己和朋友做了一个小的项目,用的是vue3.x版本,本地dev运行的时候接口什么的都是正常的,但是build打包后本地使用anywhere启动一个本地服务的时候发现接口报错405状态,发布到线上接 ...
随机推荐
- java常用API之字符串缓冲区
StringBuffer类: StringBuffer是个字符串的缓冲区,是可变的字符串数组,即就是它是一个容器,容器中可以装很多字符串.并且能够对其中的字符串进行各种操作 StringBuffer的 ...
- sql:无法解决 equal to 操作中 "Chinese_PRC_CI_AS" 和 "Chinese_Taiwan_Stroke_CI_AS" 之间的排序规则冲突。
--无法解决 equal to 操作中 "Chinese_PRC_CI_AS" 和 "Chinese_Taiwan_Stroke_CI_AS" 之间的排序规则冲 ...
- Django——CBV与FBV
一.FBV FBV(function base views) 就是在视图里使用函数处理请求. 二.CBV CBV(class base views) 就是在视图里使用类处理请求. Python是一个面 ...
- 18_CGLib动态代理
[概述] 已知JDK动态代理中的Proxy.newProxyInstance(ClassLoader loader,Class[] interfaces,InvocationHandler h)方法的 ...
- 使用CKRule实现PVC配方计算
1,PVC计算的基本原理 配方员设计好配方,再进行抽象提炼,会出现相对于软件而言可以理解的逻辑,如属性的概念,对厂企生成的PVC产品而言,一般都有产品大类名称,花纹,颜色,长度,宽度,厚度等概念,这对 ...
- Zygote和System进程的启动过程
##init脚本的启动 +------------+ +-------+ +-----------+ |Linux Kernel+--> |init.rc+-> |app_process| ...
- gamemakerstudio:room_speed和image_speed
room_speed是游戏步数,每秒多少步(步事件)image_speed是动画帧率room_speed变则整个游戏变慢image_speed变只是该object动画变慢 除了游戏全局加速减速,一般不 ...
- Java中long和Long有什么区别(转)
Java的数据类型分两种:1.基本类型:long,int,byte,float,double,char2. 对象类型(类): Long,Integer,Byte,Float,Double,Char,S ...
- 点击一个按钮,如何让一个<div id=a>……</div>隐藏或显现?
<div id=divid>123</div>< button onclick="usr()">Click</button>< ...
- HTML:一个form表单有两个按钮,分别提交到不同的页面
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...