将 Python 3.6 脚本转换为 .exe? [英] Converting Python 3.6 script to .exe?
本文介绍了将 Python 3.6 脚本转换为 .exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将 .py 文件转换为 .exe.我正在使用 Python 3.6.我已经尝试过 py2exe 和 PyInstaller,但它们似乎无法在 Python 3.6 中正常工作.
I would like to convert a .py file to an .exe. I am using Python 3.6. I already tried py2exe and PyInstaller but they don't seem to work properly with Python 3.6.
推荐答案
那么,让我们先试试 Pyinstaller.
So, let's try Pyinstaller first.
$ pyinstaller script.py --onefile
这将生成一个 script.spec 文件在规范文件中,您可以删除控制台、调试模式等
This will generate a script.spec file in the spec file you can remove the console, debug mode etc
$ pyinstaller script.py
如果这不起作用,那么我们可以尝试 cx_freeze,
If this doesn't work then we can try cx_freeze,
这篇关于将 Python 3.6 脚本转换为 .exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文