I\'m working on using pyinstaller to create an .exe for a python program that uses pandas and sklearn. The pyinstaller process completes and produces the dist folder with th
You need to go into the hook-scipy.py (or create one) and have it look like this:
from PyInstaller.utils.hooks import collect_submodules
from PyInstaller.utils.hooks import collect_data_files
hiddenimports = collect_submodules('scipy')
datas = collect_data_files('scipy')
then go into the hook-sklearn.metrics.cluster.py file and modify it to look like this:
from PyInstaller.utils.hooks import collect_data_files
hiddenimports = ['sklearn.utils.sparsetools._graph_validation',
'sklearn.utils.sparsetools._graph_tools',
'sklearn.utils.lgamma',
'sklearn.utils.weight_vector']
datas = collect_data_files('sklearn')
I do not know if this part is necessary but I also created a hook-sklearn.py file that looks like this:
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('sklearn')
In the cmd I used pyinstaller test.py -F
to create one file.
Then it should work: