Got it! Thank you On Monday, January 31, 2022 at 2:28:33 PM UTC+5:30 bwoodsend wrote:
> 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 > [email protected] 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/4b278132-fdc4-4eae-9fc5-b403f74030b0n%40googlegroups.com.
