简体   繁体   English

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

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

I tried making my python file into an exe using pyinstaller main.py --onefile --noconsole .I was getting an error when I tried opening the exe from dist so i used --debug=all and it said pyinstaller: error: the following arguments are required: scriptname .我尝试使用pyinstaller main.py --onefile --noconsole将我的 python 文件制作成一个 exe。当我尝试从 dist 打开 exe 时出现错误,所以我使用了--debug=all并且它说pyinstaller: error: the following arguments are required: scriptname

What exactly do i do im not too sure as its my first time.我到底在做什么,因为这是我的第一次,我不太确定。

To convert a python file to exe:要将 python 文件转换为 exe:

  1. Make sure you have pyinstaller installed and up to date确保你已经安装了 pyinstaller 并且是最新的

    pip install pyinstaller

  2. in PowerShell type the following:在 PowerShell 中键入以下内容:

    pyinstaller --onefile -w 'youfilename.py'

The file name should come out as 1.exe Make sure are in the right directory文件名应该是1.exe确保在正确的目录中

If you have more doubts use this link: https://www.geeksforgeeks.org/convert-python-script-to-exe-file/如果您有更多疑问,请使用此链接: https : //www.geeksforgeeks.org/convert-python-script-to-exe-file/

暂无
暂无

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

相关问题 我试图读取在我的 Python 程序中以文本形式写入的日志文件,但它返回“没有这样的文件或目录” - Im trying to read a log file which is written in text in my Python program but its returning an “No such file or directory” 试图删除文件但它不工作 - trying to delete file but its not working 如何将python文件转换为exe文件,以便可以屏蔽代码 - How to turn a python file to an exe file, so that the code can be masked 在python中运行exe文件 - 不工作 - Running an exe file in python - not working 如何在没有此错误的情况下将 python 文件转换为 exe 文件 - How can I turn a python file into a exe file withou this error 我试图计算 model object 但它不起作用 - im trying to count model object but its not working Python:我正在尝试编写一个文本文件,但它一直被清除 - Python: im trying to write a text file but it just keeps getting cleared 我正在尝试部署我的 ml model 来对植物图像进行分类,但是即使路径正确,我也找不到文件错误 - Im trying to deploy my ml model which classifies plant images, but im getting file not found error even though its path is correct .exe 文件的绝对路径在 python 中无法正常工作 - Absolute path of .exe file not working properly in python python - 试图将 csv 文件变成更干净的 csv! Python 和 Stack 的新手 - python - trying to turn a csv file into a cleaner csv! new to python and Stack
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM