pyinstaller Unable to access file

Viewed 507

I wrote a simple code in python/pygame, and the game was running fine in both sublime text and cmd, but when I tried to make it a exe file pyinstaller --onefile version2.py, I got an error and I don't know what is the problem ?

enter image description here

1 Answers

Well bro, I don't know if I will be helpfull to you know after 6 days, I am having 2 solutions for you which worked for me today.

  1. Disable Antivirus OR put that folder in which you are building app.exe to Exception, like I have done below [Mandatory Process]. enter image description here
  1. Dont' run pyinstaller command from the directory where app.py application is present. a) Get out from that directory/folder b) Create new directory/folder c) Enter that directory and start cmd in that directory/folder by pressing (shift + MouseRightClick ) d) And then run the command

    pyinstaller --name "MyApp" "python script file path of which you want to create .exe file"
    

Where "MyApp" is the name which you want to give to the file after it is build successfully

For Example

pyinstaller --name "FileRenamer" "G:\data\python\Project\Bunch File Renamer\rename.py"
Related