簡體   English   中英

如何將 Python 文件轉換為 .exe 文件?

[英]How can I convert a Python file to a .exe file?

我在網上看到了很多選項,但似乎沒有一個支持 Python 3.8。 有沒有辦法將python項目轉換為.exe? 如果是這樣,我該怎么做?

編輯:我已經多次嘗試 PyInstaller,無論是在推薦這里之前還是之后,但我不斷收到大量錯誤消息,我不知道如何理解。

使用pyinstaller

示例: pyinstaller yourfile.py -F --onefile

這會將您的代碼轉換為 Windows 上的.exe文件。

要安裝 PyInstaller,您只需使用 pip,即pip install PyInstallerpip3 install PyInstaller

您還可以確保您擁有最新的 pyinstaller 開發版本: pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM