Solution about python module tabula runs .py successfully and use pyinstaller to build .exe but the .exe will execute fail.
pip3 installer tabula-py
pip3 list
py -3.7 compare_BCU_RN.py
pyinstaller -F compare_BCU_RN.py
Also don't have any warning or error in build/warn.txt and build/xerf.html
Run .exe (double click/power shell/cmd).
Module tubalu is Java base and made for running on OS(JVM).
…
Tabula allows you to extract that data in CSV format, through a simple web interface.
…
Therefore, it does not consider supporting source code (python module source code) for being built into exe by pyinstaller.
It means that it actually just uses python-command to execute Tabula-Java.
You can refer to tabula-py/tabula/io.py
This is the result of the error you saw when executing exe in powershell in the previous picture.
Notice : Just install java CANNOT fix this error.
But if you want to run in python script, install and check path is fine
Let the .spec(pyinstaller actually build spec, refer "知呼-Pyinstaller打包通用流程" under) to pack "tabula" data file.
Run pyinstaller -F {your}.py
Modify {your}.spec :
from PyInstaller.utils.hooks import collect_data_files
datas=[],
to datas=collect_data_files("tabula"),
Run python pyinstaller {your}.spec
Notice : Is .spec instead of .py
It will take a lot of time if you have to manually modify it every time.
So you can use my .bat script:
You just run this .bat every time after saved {your}.py, remember put it at the same folder with {your}.py.
Error Fixed !!
If you don't want to make a new file, maybe you can try this solution :
stackoverflow-Unable to access jarfile 'tabula-1.0.2-jar-with-dependencies.jar'
tabula
python
pyinstaller