Python文件封装成EXE(可执行文件)

Section 1 - 创建纯python环境

创建一个python环境,最好32位的,这样执行生成的exe可以在32位系统和64位系统上运行,此外,打包编译的exe也不至于过于庞大,以及出现总是打包不成功的问题。

Section 2 - 执行pip install pyinstaller

在纯python环境中pip命令下执行。

Section 3 - 修改配置文件:

# -*- mode: python -*-

block_cipher = None


a = Analysis(['curve_extract.py'],
             pathex=[],
             binaries=[],
             datas=[],
             hiddenimports=['pandas', 'scipy', 'numpy', 'math'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=

你可能感兴趣的:(python,开发语言,后端)