Python - '找不到适合ods的库'Pyinstaller

时间:2017-01-26 14:12:16

标签: python-3.x pyinstaller pyexcel

我编写了一个脚本,打开并从<xs:attribute name="bus_ref" type="xs:string" use="required"/> <!--...--> <xs:attribute name="bus_ref" use="required" type="xs:string"/> 文件中提取值并创建新工作表并使用.odspyexcel写入值。转换为可执行文件后,我收到此错误pyexcel_ods3

代码:

No suitable library found for ods

pyexcel - 0.4.2 pyexcel-io - 0.3.1 pyexcel-ods3 - 0.3.0 PyInstaller - 3.2.1

PS:我试过隐藏的导入和钩子。我做了一些工作,并认为 sheet = pyexcel.get_sheet(file_name="sample.ods") __import__ manager.py pyexcel_io

2 个答案:

答案 0 :(得分:1)

您确定问题不在于使用pyexcel读取.ods文件吗?尝试使用pyexcel_ods3从.ods文件中获取数据:

SELECT *
FROM MyTable
WHERE CreatedAt > DATEADD(ms, -60000, GETDATE());  -- 60000 ms = 1 minute

一旦您的脚本可以使用pyexcel_ods3,请参考http://io.pyexcel.org/en/latest/pyinstaller.html来添加隐藏导入。

我最近遇到了类似的问题,但后来我修复了代码,并以这种方式获得了可运行的.exe。

答案 1 :(得分:0)

您可能需要告诉PyInstaller将pyexcel_ods3库添加到hidden_imports命令行参数中。

实现相同目标的另一种方法是在您的某个应用的代码文件中明确导入pyexcel_ods3。这将导致PyInstaller将库识别为依赖项。