Joined this Google Group so that I could confirm that bwoodsend's solution 
works.

I was using PyInstaller for my application and I got the exact same 
ModuleNotFoundError that Debabrata had. Using the --collect-submodules= for 
each missing module like bwoodsend recommended eventually led to a 
successful executable.

I'm using python 3.12.3. These are the three (luckily, it was only three 
and not more) modules that I had to use --collect-submodules= with:
- numpy.f2py
- scipy._lib.array_api_compat.numpy.fft
- scipy.special._special_ufuncs
I found these three by adding them to my command one at a time and then 
checking the crash message for the next module to collect.

My command to run pyinstaller that worked (with my venv activated):
pyinstaller --onefile --noconsole --name=EXECUTABLE_NAME 
--collect-submodules=numpy.f2py 
--collect-submodules=scipy._lib.array_api_compat.numpy.fft 
-collect-submodules=scipy.special._special_ufuncs PATH_OF_MAIN_FILE.py

Out of curiosity, I used a separate venv built with python 3.9.6 and 
discovered that I only needed to use --collect-submodules= for numpy.f2py. 
In both instances, I'm using the latest version (as of the day of this 
post) of all my packages. PyInstaller could have some strange interactions 
with python 3.12.3 that I'm unaware of.

I'd be surprised if there was not a faster way to include missing 
submodules, but this one-by-one method worked for me.
On Friday, June 28, 2024 at 5:27:03 AM UTC-4 bwoodsend wrote:

> Then add --hiddenimport=scipy._lib.array_api_compat.numpy.fft too
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/0642be03-f0a6-4349-8581-abd6801f9674n%40googlegroups.com.

Reply via email to