我正在尝试使用带有以下命令的 pyinstaller 将 python 文件转换为 .exe。请提出这种方法有什么问题。
pyinstaller.exe --hidden-import pyexcel --hidden-import pyexcel-io --hidden-import pyexcel_xls --hidden-import pyexcel_xlsx -F FormatBuster.py
该项目有额外的 pyexcel_xls 导入,pyexcel_xlsx 正在使用 --hidden-import 参数处理。运行 .exe 时出现以下错误,但是当直接执行 .py 文件时,它运行良好。
Traceback (most recent call last):
File "FormatBuster.py", line 90, in <module>
File "site-packages\pyexcel\core.py", line 36, in get_sheet
File "site-packages\pyexcel\internal\core.py", line 19, in get_sheet_stream
File "site-packages\pyexcel\internal\source_plugin.py", line 76, in get_source
File "site-packages\pyexcel\internal\source_plugin.py", line 65, in get_a_plugin
File "site-packages\pyexcel\internal\source_plugin.py", line 48, in load_me_now
File "site-packages\pyexcel\internal\source_plugin.py", line 138, in _error_handler
pyexcel.exceptions.UnknownParameters: Please check if there were typos in function parameters: {'file_name': 'C:\\Users\\kiranv1\\Documents\\R&D\\FormatBuster\\input\\DDVIJAYA_13_Apr_2018_Lot_1.xls'}. Otherwise unrecognized parameters were given.
[146004] Failed to execute script FormatBuster
python文件使用.config文件,内容如下图
{
"params":{
"inputpath":"C:\\Users\\kiranv1\\Documents\\R&D\\FormatBuster\\input",
"outputpath":"C:\\Users\\kiranv1\\Documents\\R&D\\FormatBuster\\output",
"logpath":"C:\\Users\\kiranv1\\Documents\\R&D\\FormatBuster\\output",
"files": {
"DDVIJAYA" : {
"Due Date":"T2D",
"Instalment No.":"T2N",
"Instalment Amount":"T2N"
}
}
}
}