美文网首页
pyinstaller 使用过程中的小问题

pyinstaller 使用过程中的小问题

作者: 乐活北京 | 来源:发表于2021-01-04 10:23 被阅读0次

    背景

    1. mac 电脑
    2. 希望将python文件打包成可执行文件

    问题

    1. 执行pyinstaller -F **.py
    2. ./dist/*** 可执行文件
      报如下错误:
    Traceback (most recent call last):
      File "site-packages/PyInstaller/loader/rthooks/pyi_rth__tkinter.py", line 30, in <module>
    FileNotFoundError: Tcl data directory "/var/folders/xf/hms3dl112jxgjllkrjsysy05nt2l4d/T/_MEIOsITDy/tcl" not found.
    [56538] Failed to execute script pyi_rth__tkinter
    
    

    解决方案:

    pyinstaller --onefile --add-binary='/System/Library/Frameworks/Tk.framework/Tk':'tk' --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl'
    

    总结

    1. 希望能帮到你
    2. 祝你好运

    相关文章

      网友评论

          本文标题:pyinstaller 使用过程中的小问题

          本文链接:https://www.haomeiwen.com/subject/jzjroktx.html