【问题标题】:auto-py-to-exe converted python file, fails to execute自动py到exe转换的python文件,执行失败
【发布时间】:2021-09-19 01:25:57
【问题描述】:

我有一个简单的 scipt,它可以让我知道特定日期的时间,我正在使用带有此命令的 pyinstaller 将其转换为 .exe 文件以提供给我的朋友:

pyinstaller --onefile --windowed "D:/Documents/code/own/python/sages_birthday/time_till_meetup.py"

当我尝试执行创建的文件时,我得到这个窗口作为错误:

我已经使用--console 而不是--windowed 创建了一个文件以尝试获取更多信息,但我什至没有弹出错误或任何其他信息。

【问题讨论】:

  • 它似乎找不到模块并给我这个错误:Error: The 'win'10toast' distribution was not found and is required by the application 后跟 Traceback 错误消息。

标签: python windows pyinstaller exe file-conversion


【解决方案1】:

第 1 步:将 Python 添加到 Windows 路径
步骤 2:打开 Windows 命令提示符
第 3 步:安装 Pyinstaller 包
pip install pyinstaller

第 4 步:保存 Python 脚本
第 5 步:使用 Pyinstaller 创建可执行文件
cd followed by the location where your Python script is stored
第 6 步:pyinstaller --onefile pythonScriptName.py
第 7 步:运行可执行文件 在该位置创建的其他文件很少。查找可执行文件 文件,打开 dist 文件夹:

【讨论】:

  • 我这样做了,但它不起作用,但它可能是我正在使用的模块之一。我现在正在更换它,希望它可以工作。
  • 这对事实没有帮助。
猜你喜欢
  • 2019-12-16
  • 2019-12-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多