And presumably your Python code references this file using something like

filename = "weight_res1.h5"

which assumes that weight_res1.h5 is in your current working directory 
instead of

import os
filename = os.path.join(os.path.dirname(__file__), "weight_res1.h5")

which assumes that weight_res1.h5 is next to you application.py? In which 
case your code is broken even without PyInstaller if you don’t set your 
working directory to the directory containing your code . There’s a bit 
more on the topic here 
<https://pyinstaller.readthedocs.io/en/stable/runtime-information.html#placing-data-files-at-expected-locations-inside-the-bundle>
.
​
On Thursday, January 27, 2022 at 9:27:04 AM UTC 
siddesh.1...@pe.iitism.ac.in wrote:

> [image: Screenshot (143).png]My Python script, application.py, uses 
> weight_res1.h5 files  located in the same directory as application.py and 
> throwing this error

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/17079441-e8a6-49d0-9cb2-80bcb6e8667an%40googlegroups.com.

Reply via email to