python - 我试图将 python 文件转换为 exe 文件,但它不起作用

我尝试使用 pyinstaller main.py --onefile --noconsole 将我的 python 文件制作成一个 exe .当我尝试从 dist 打开 exe 时出现错误,所以我使用了 --debug=all 并且它说 pyinstaller: error: the following arguments are required: scriptname .

我第一次做时不太确定。

最佳答案

将 python 文件转换为 exe:

  1. 确保您安装了 pyinstaller 并且是最新的

    pip 安装 pyinstaller

  2. 在 PowerShell 中键入以下内容:

    pyinstaller --onefile -w 'youfilename.py'

文件名应该是 1.exe 确保在正确的目录中

如果您有更多疑问,请使用此链接:https://www.geeksforgeeks.org/convert-python-script-to-exe-file/

https://stackoverflow.com/questions/64415004/

相关文章:

html - 使一个 div 填充具有未指定尺寸的表格单元格的整个宽度和高度

reactjs - Chrome,Edge - 禁用字段的自动填充/自动完成

reactjs - 在 useEffect Hook 中使用 axios 取消 token 时如何修

android - x + 宽度必须 <= bitmap.width()

reactjs - typescript 错误对象的类型为 'unknown'

asp.net-core - 我可以在 AspNetCore WebAPI 中将 Cancellat

angular - 如何限制 NgSelect 下拉面板中显示的项目数?

python - 'google-api-python-client' distribution 在

javascript - 错误 : Jmeter: Typed variable declarati

javascript - 在输入焦点上移动/动画占位符