3

This is my first question I am using pyexcel in my python(3.7.4) script and it worked well. However after creating an exe file using Pyinstaller my exe file cannot run as it was .py

Here is the error while the program is running: (These problem didn't occur while I run .py script)

  File "site-packages\pyexcel\core.py", line 110, in save_book_as

  File "site-packages\pyexcel\internal\core.py", line 39, 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 19, in parse_file

  File "site-packages\pyexcel\plugins\parsers\excel.py", line 40, in _parse_any

  File "site-packages\pyexcel_io\io.py", line 73, in get_data

  File "site-packages\pyexcel_io\io.py", line 91, in _get_data

  File "site-packages\pyexcel_io\io.py", line 190, in load_data

  File "site-packages\pyexcel_io\plugins.py", line 90, in get_a_plugin

  File "site-packages\lml\plugin.py", line 290, in load_me_now

  File "site-packages\pyexcel_io\plugins.py", line 107, in raise_exception

pyexcel_io.exceptions.SupportingPluginAvailableButNotInstalled: Please install pyexcel-xls

I already did all hidden import followed by https://pyexcel-io.readthedocs.io/en/latest/pyinstaller.html and https://pyexcel.readthedocs.io/en/latest/pyinstaller.html

This is my hidden import script used via command prompt

--hidden-import pyexcel.plugins.renderers.sqlalchemy --hidden-import pyexcel.plugins.renderers.django --hidden-import pyexcel.plugins.renderers.excel --hidden-import pyexcel.plugins.renderers._texttable --hidden-import pyexcel.plugins.parsers.excel --hidden-import pyexcel.plugins.parsers.sqlalchemy --hidden-import pyexcel.plugins.sources.http --hidden-import pyexcel.plugins.sources.file_input --hidden-import pyexcel.plugins.sources.memory_input --hidden-import pyexcel.plugins.sources.file_output --hidden-import pyexcel.plugins.sources.output_to_memory --hidden-import pyexcel.plugins.sources.pydata.bookdict --hidden-import pyexcel.plugins.sources.pydata.dictsource --hidden-import pyexcel.plugins.sources.pydata.arraysource --hidden-import pyexcel.plugins.sources.pydata.records --hidden-import pyexcel.plugins.sources.django --hidden-import pyexcel.plugins.sources.sqlalchemy --hidden-import pyexcel.plugins.sources.querysets --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-import pyexcel_xls --hidden-import pyexcel_xls.xls --hidden-import pyexcel_xls.xlsr --hidden-import pyexcel_xls.xlsw

and also I have installed these below.

pyexcel==0.5.15

pyexcel-io==0.5.20

**pyexcel-xls==0.5.8**

pyexcel-xlsx==0.5.8

PyInstaller==4.0.dev0+55c8855d9d

Thank you for every comment and answer!!

PS. I already installed pyexcel-xls==0.5.8 and added --hidden-import pyexcel_xls.xls

UPDATE: The exe. still have the same problem. Should I post the Log of Pyinstaller or some of my imported libralies in my Python scripts?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
k54126
  • 31
  • 4

1 Answers1

0

First, make sure that you download all files by following these instruction

Then, You have to specify the plugins in its hidden import options

 pyinstaller run.py   --hidden-import pyexcel_xls --hidden-import pyexcel_xls.xls   --hidden-import pyexcel_xlsx --hidden-import pyexcel_xlsx.xlsx

#note make sure that you use the hidden import options for your version and you can select your version from the tab Read the Docs

See this and this answer

If you found a bug in PyInstaller you can try downloading the latest version

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
I_Al-thamary
  • 3,385
  • 2
  • 24
  • 37
  • 1
    Yes, I am using that Pyinstaller zip, trying to figure out that the problem come out from the installer or my import method, I will update the result soon. Thank you very much. – k54126 Jan 30 '20 at 08:19
  • I run the code and it works in python 3.7. What is the python version that you use – I_Al-thamary Jan 30 '20 at 09:22
  • See this https://www.youtube.com/watch?time_continue=160&v=lOIJIk_maO4&feature=emb_logo – I_Al-thamary Jan 30 '20 at 09:27
  • Mine is 3.7.4, most of my main script is openpyxl and wx used for read database and calculate it, I just used the pyexcel to convert file type from xls to xlsx so that openpyxl can operate with the xlsx file, upfortunately the error occured in exe program. – k54126 Jan 30 '20 at 09:32
  • I notes that you use an old version of `pyinstaller` and you use the hidden import options for the latest version one. You have to install the latest version and use this http://io.pyexcel.org/en/v0.5.11/pyinstaller.html – I_Al-thamary Jan 30 '20 at 09:36
  • Follow this instruction https://infotechmanagefactory.com/convert-xls-xlsx-python/ – I_Al-thamary Jan 30 '20 at 09:39