繁体   English   中英

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

[英]Im trying to turn a python file into an exe file and its not working

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

我到底在做什么,因为这是我的第一次,我不太确定。

要将 python 文件转换为 exe:

  1. 确保你已经安装了 pyinstaller 并且是最新的

    pip install pyinstaller

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

    pyinstaller --onefile -w 'youfilename.py'

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM