I successfully edited my spec file and added a folder with my data. It builds fine, but still cannot access the data. When I try to run the compiled .exe, I get this error: Error loading Python DLL: C:\Users\Sal\AppData\Local\Temp\_MEI60122\python27.dll (error code 126)
EDIT 1 - I still do not understand what my specification file is as follows:
a = Analysis(['Clock_In.py'], pathex=['C:\\Users\\Sal\\Desktop'], hiddenimports=[], hookspath=None, runtime_hooks=None) a.datas += [('CO_time.pkl','CO_time.pkl', 'DATA')] a.datas += [('hours.pkl','hours.pkl', 'DATA')] a.datas += [('Obj_file.pkl','Obj_file.pkl', 'DATA')] a.datas += [('weekly_hours_dict.pkl','weekly_hours_dict.pkl', 'DATA')] pyz = PYZ(a.pure) exe = EXE(pyz, a.datas, a.binaries, a.scripts, exclude_binaries=True, name='Clock_In.exe', debug=False, strip=None, upx=True, console=True, icon="C:\Users\Sal\Desktop\Raindropmemory-Legendora-BrokenSword.ico") coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, strip=None, upx=True, **name='Clock_In')
EDIT 2
I use 32-bit python on a 64-bit OS (Windows 8), and I was informed that this could potentially cause problems, but still no solution.
EDIT 3
So, I just tried downloading a 64-bit python and putting it in my system path. pyinstaller is running with my .spec file and still got the same error code! What's going on here! An interesting detail is that the icon="C:\Users\Sal\Desktop\Raindropmemory-Legendora-BrokenSword.ico") from the specification file executed and successfully updated the icon, where, as before, this did not happen.
EDIT 4
This is the statement that I have in my code for MEIPASS directly from the documentation.
if getattr(sys, 'frozen', False):