首页   /   Python   /   Python To Exe

内容

有需求,就有办法;不会,去找!


环境

    。win7 x64

    。python 2.7.14 -  win32

    。pyinstaller-2.0.zip

    。pywin32 [pywin32-220.win32-py2.7.exe]    


操作 (pyinstaller-2.0目录,不用install)

    ...\pyinstaller-2.0> python PyInstaller.py -F YourPy.py

    如果运行说导入错误的话,需要加入lib路径

    ...\pyinstaller-2.0> python PyInstaller.py -F [-p pythonlibdir]  YourPy.py


结果

    在 目录【 ...\pyinstaller-2.0】目录下增加 目录【YourPy】,exe在其中。


问题

    。pywin32要对应python的 位数【32或64】。

    。pywin32是pyinstall过程中会用到。

    。在安装pywin32时,在最后一步失败了,显示“close failed in file object destructor .....” ,但之后也能生成exe,好像不影响。


下载

    。pyinstaller-2.0.zip

            下载:http://nchc.dl.sourceforge.net/project/pyinstaller/2.0/pyinstaller-2.0.zip

    。pywin32 [pywin32-220.win32-py2.7.exe]    

            下载:https://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/


参数

image.png



参考:

https://blog.csdn.net/u010045971/article/details/51940835

https://blog.csdn.net/ztsghjls/article/details/54426169

https://blog.csdn.net/mrlevo520/article/details/51840217

https://jingyan.baidu.com/article/a378c960b47034b3282830bb.html

http://www.jb51.net/article/57157.htm

https://jingyan.baidu.com/article/47a29f247d845cc01523996d.html

* https://www.crifan.com/use_pyinstaller_to_package_python_to_single_executable_exe/