在使用 pyinstaller 生成应用程序时包含 poppler

Include poppler while generating an application using pyinstaller

我正在使用 poppler 阅读 pdf

Poppler 文件夹位于我的源文件中,如下所示。 代码如下:

    pages = convert_from_path(pdf_file,500,poppler_path = r'.\poppler\bin',
                              first_page=pageNo[0],last_page =pageNo[len(pageNo)-1] )

我想使用 pyinstaller 为我的 python 应用程序生成 exe。 但是我将它们包含在 pyinstaller command.It 似乎不起作用。

我收到以下错误: 异常无法获取页数。 poppler 是否已安装并位于 PATH 中?创建数据库数据帧时发生

以下是我尝试在我的 pyinstaller 命令中包含 poppler 的方法:

pyinstaller --noconfirm --onefile --windowed --add-data --add-data "C:/Users/projectPath/poppler/*;./poppler" "C:/Users/projectPath/AutoUpdate.py “

pyinstaller --noconfirm --onefile --windowed --add-data --add-data "C:/Users/projectPath/poppler;./poppler" "C:/Users/projectPath/AutoUpdate.py" =11=]

pyinstaller --noconfirm --onefile --windowed --add-data --add-data "C:/Users/projectPath/poppler;poppler/" "C:/Users/projectPath/AutoUpdate.py"

现在开始使用 onedir 方法而不是 onefile.Works 很好。

下面是更新的 pyinstaller 命令:

pyinstaller --noconfirm --onedir --windowed --add-data --add-data "C:/Users/projectPath/poppler/*;./poppler" "C:/Users/projectPath/AutoUpdate.py"