Python Pyinstaller Created Executable Failed To Run The Exe Error: Cannot Find Temp\\_mei175682 (data File)
Solution 1:
This will be the easy and clean solution,Check and like and vote.
When you're encountering following error.
IOError: [Errno 2] No such file ordirectory: 'C:\\Users\\username\\AppData\\Local\\Temp\\_MEI502322\\resources\\template.json'
This solution tested under Python 2.7.10 and Pyinstaller 3.0.
Put this file to your script folder. where your .py script available example 123.py
Add this hook to your distribution it means add this in below in new file, example xyx.py and keep this file where the 123.py file available
from PyInstaller.utils.hooks import collect_data_files
#Instruct pyinstaller to collect data files from resources package.
datas = collect_data_files('resources')
since this is the error C:\Users\my_username\AppData\Local\Temp\_MEI175682\resources\template.json "resources" is the package where from you have to take the data file.
Now run the following in command window from your 123.py folder
pyinstaller --onefile --additional-hooks-dir=. 123.py
exe will be created run the exe and check it is taking the data file.
thanks to Panda1100
Post a Comment for "Python Pyinstaller Created Executable Failed To Run The Exe Error: Cannot Find Temp\\_mei175682 (data File)"