0

当我创建一个 exe 文件并尝试在这里运行它时,我得到了一个异常:

 Exception in Tkinter callback
Traceback (most recent call last):
File "tkinter\__init__.py", line 1702, in __call__
File "static_data_final01.py", line 86, in lets_go
File "static_data_final01.py", line 99, in EMT
File "site-packages\pyexcel\core.py", line 111, in save_book_as
 File "site-packages\pyexcel\internal\core.py", line 33, in get_book_stream
File "site-packages\pyexcel\plugins\sources\file_input.py", line 39, in 
get_data
File "site-packages\pyexcel\plugins\parsers\excel.py", line 18, in 
parse_file
File "site-packages\pyexcel\plugins\parsers\excel.py", line 39, in 
_parse_any
 File "site-packages\pyexcel_io\io.py", line 71, in get_data
 File "site-packages\pyexcel_io\io.py", line 89, in _get_data
 File "site-packages\pyexcel_io\io.py", line 185, in load_data
 File "site-packages\pyexcel_io\plugins.py", line 90, in get_a_plugin
 File "site-packages\lml\plugin.py", line 293, in load_me_now
 File "site-packages\pyexcel_io\plugins.py", line 107, in raise_exception
pyexcel_io.exceptions.SupportingPluginAvailableButNotInstalled: **Please 
install pyexcel-xls**

请不要说这张票是来自:Unable to use pyexcel-xls with pyinstaller 的副本。python 可执行文件不工作。python 版本 3.4.4 ,因为我试图将更改后的文件复制到我的pyexcel_io/__init__.py 中,但它仍然无法正常工作

我正在使用 Visual Studio 2017 Python 3.6,当我尝试pip install pyexcelpip install pyexcel-io时,我得到了这个:

 ----- Installing 'pip install pyexcel' -----
Collecting pip
Using cached 

https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl

Collecting install
Could not find a version that satisfies the requirement install (from 
versions: )
No matching distribution found for install
----- Failed to install 'pip install pyexcel' -----

这是我从 Cmd 运行的命令:pyinstaller.exe --onefile static_data_final01.py --hidden-import pyexcel_io.readers.csvr --hidden-import pyexcel_io.readers.csvz --hidden-import pyexcel_io.readers.tsv -- hidden-import pyexcel_io.readers.tsvz --hidden-import pyexcel_io.writers.csvw --hidden-import pyexcel_io.readers.csvz --hidden-import pyexcel_io.readers.tsv --hidden-import pyexcel_io.readers.tsvz -- hidden-import pyexcel_io.database.importers.django --hidden-import pyexcel_io.database.importers.sqlalchemy --hidden-import pyexcel_io.database.exporters.django --hidden-import pyexcel_io.database.exporters.sqlalchemy --hidden-导入 pyexcel_xls --hidden-import pyexcel_xls.xlsr --hidden-import pyexcel_xls.xlsw --hidden-import pyexcel.plugins --hidden-import pyexcel.plugins.parsers --hidden-import pyexcel.plugins.renderers --hidden-导入pyexcel。plugins.sources --hidden-import pyexcel.plugins.sources.file_input --hidden-import pyexcel.plugins.parsers.excel --hidden-import pyexcel_xls --hidden-import pyexcel_xls.xls --hidden-import pyexcel_xlsx --hidden -import pyexcel_xlsx.xlsx --hidden-import pyexcel_xls --hidden-import pyexcel_xls.xls

此外,当我从 Visual Studio 运行我的脚本时,我的应用程序运行良好!

4

1 回答 1

0

由于我还没有找到使用 pyexcel 的合适解决方案,因此我发现了其他可以与 PyInstaller 完美配合的模块。

模块名称是 xlrd。

这是一个链接

于 2018-11-29T12:12:58.930 回答