Ughh, I’ve seen that snippet of misinformation before on stackoverflow. The 
code in the *else* block is what you should be running unconditionally. If 
that can’t find your resources then you’re putting your data files in the 
wrong place inside your application and you should adjust the DEST part of 
your --add-data flags until it does work. There is also a sys._MEIPASS 
variable that also gives you the application’s path but again, I try to 
steer people away from that because 99% of the time they’d be better off 
using __file__.

That code snippet works in PyInstaller <6 (well no, it breaks under onefile 
mode, but under onedir mode it worked) because 
os.path.dirname(sys.executable) used to, by happenstance rather than 
design, equal sys._MEIPASS. PyInstaller 6.0 moved most of the application 
into this new _internal directory though so now those two are no longer 
equal.
​

-- 
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/30893c86-5fc6-4aab-89ab-79ade020ea67n%40googlegroups.com.

Reply via email to