Pyinstaller打包引用其他文件(.py或其他格式)的.py文件

Pyinstaller打包多个.py文件

  • 一、安装Pyinstaller
  • 二、使用步骤
    • 1.进入主程序目录生成.spec文件
    • 2.修改.spec文件以导入其他文件
    • 3.运行.exe文件

一、安装Pyinstaller

pip install pyinstaller

二、使用步骤

1.进入主程序目录生成.spec文件

在这里插入图片描述

该路径下生成两个文件夹build和dist,一个.spec文件
Pyinstaller打包引用其他文件(.py或其他格式)的.py文件_第1张图片

2.修改.spec文件以导入其他文件

未修改的.spec文件内容如下:

# -*- mode: python ; coding: utf-8 -*-

block_cipher = None


a = Analysis([video_test.py'],
             pathex=['D:\\Python37\\FCN-DenseNet-master-1'],
             binaries=[],
             datas=[],
             hiddenimports=[

你可能感兴趣的:(pyinstaller)