PyInstaller: a module is not included into --onefile, but works fine with --onedir
I'm using PyInstaller to bundle my application into one .exe file. The problem is that it works fine with --onedir option, but can't find a module when built with --onefile. Both --onedir and --onefile say during the building process: <...> INFO: Analyzing hidden import 'sklearn.utils.sparsetools._graph_validation' <...> Running the instance created with --onedir works fine, but the instance produced by --onefile dies: <...> File "_min_spanning_tree.pyx", line 8, in init sklearn.utils.mst._min_spanning _tree (sklearn\utils\sparsetools\_min_spanning_tree.c:4754) ImportError: No module named