PyInstaller 5.8 failing to import scipy.stats file “_sobol_direction_numbers.npz”!

35 views
Skip to first unread message

Debabrata Sarkar

unread,
Feb 13, 2023, 7:18:26 AM2/13/23
to PyInstaller
Hi PyInstaller Team,

In continuation of my Feb 09 message, please note that PyInstaller 5.8 is failing to import scipy.stats file "_sobol_direction_numbers.npz” while freezing a program (that uses 11 functions from scipy.stats) to one-dir. As a result, the following scipy FileNotFoundError is generated while executing the pyinstaller-freezed program:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/debabrata/Myprograms/program_dist/dist/program/scipy/stats/_sobol_direction_numbers.npz'

Exception ignored in: 'scipy.stats._sobol._initialize_v'

FileNotFoundError: [Errno 2] No such file or directory: '/Users/debabrata/Myprograms/program_dist/dist/program/scipy/stats/_sobol_direction_numbers.npz'

A have found a hack (https://stackoverflow.com/questions/74454338/filenotfounderror-scipy-libs) that could temporarily resolve the issue:

Copy the “_sobol_direction_numbers.npz” file from the virtual environment, e.g., “/Users/debabrata/anaconda3/envs/venv/lib/python3.9/site-packages/scipy/stats/_sobol_direction_numbers.npz” to the PyInstaller one-dir "dist" folder, e.g.,  “/Users/debabrata/Myprograms/program_dist/dist/program/scipy/stats”

Could you please come up with a permanent solution?

Regards.


Reply all
Reply to author
Forward
0 new messages