0

I am trying to execute TKinter .py file into .exe file with the following command:

pyinstaller.exe --onefile Weather_App.py

In the command prompt, I receive the following error:

PermissionError: [Errno 13] Permission denied: 'C:\Users\Owner\Documents\Python Scripts\TKinter_Projects\Weather_App.spec'

this is the link to a screenshot

Please could anyone help? I tried everything I could. (Please let me know if I need to upload more info, this is my first question).

Thanks all.

Yana
  • 3
  • 1
  • 4
  • Try executing pyinstaller.exe with Admin / Superuser permissions – ibaguio Mar 30 '20 at 16:54
  • 3
    Is the .spec file created at that location?, if so run the spec file. This may be an overzealous antivirus holding the file open immediately after it's creation while pyinstaller is trying to access it, or the file isn't where pyinstaller thinks it is. – tgikal Mar 30 '20 at 17:37
  • tgikal, you are absolutely right, the antivirus was a problem! I didn't work out how to run .spec file, but I temporary disabled 'safe files' option in my antivirus and it worked :) Thank you – Yana Mar 31 '20 at 09:57
  • how do I vote for a comment to be the right answer? – Yana Mar 31 '20 at 09:58

2 Answers2

1

When I create an exe file using pyinstaller then antivirus removing the exe file instantly.

but finally, pyinstaller worked for me after following these ways.

hope it works for you

vinod
  • 535
  • 5
  • 10
-2

Did you try running command prompt as an administrator? That may be why your permission is denied.