【问题标题】:When i converting my Py file to exe i am getting "[1516]Failed to execute script" error当我将 Py 文件转换为 exe 时,出现“[1516] 执行脚本失败”错误
【发布时间】:2019-12-21 21:43:32
【问题描述】:

我在 cmd 上使用这个命令:

pyinstaller --onefile "Tkinter Final".py

然后它正在转换为 exe,但是当我想启动 .exe 文件时,我收到了错误:

This is the image shows the error

【问题讨论】:

  • answer 能解决您的问题吗?
  • 尝试在你的环境中使用 Python 3.6

标签: python tkinter pyinstaller


【解决方案1】:

也许将numpy.random 添加到隐藏的导入中会起作用。

Documentation about hidden import

【讨论】:

  • 但是您的方法不起作用。我用这种方式遇到了同样的错误。
  • 您是否尝试添加答案中提到的三个导入?
【解决方案2】:

我已经解决了在导入熊猫之前添加这些的问题

import numpy.random.common
import numpy.random.bounded_integers
import numpy.random.entropy

编辑:您也可以在 cmd 上使用此方法:

pyinstaller --hidden-import="numpy.random.common" --hidden-import="numpy.random.bounded_integers" --hidden-import="numpy.random.entropy" yourfilename.py

【讨论】:

    猜你喜欢
    • 2021-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-16
    • 1970-01-01
    • 2016-08-15
    • 1970-01-01
    相关资源
    最近更新 更多