Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pyinstaller- python exe stopped working: "Cannot open self"

I have been using Pyinstaller to convert python scripts into executables. It has worked for me just fine in the past. However now when I try to run the executables (both old ones and new ones) I get the error "Cannot open self _____ or archive _____", where the first blank is the path of the executable and the second is the path of an archive that does not exist, ending in ".pkg". I did change the path of the source code, but that should not be preventing new executables I made after the switch from working, and isn't the point of compiling a .py into a .exe mobility?

I am on windows 7, using the cmd window to run the executables (which I'll repeat has worked in the past.) I'm using Python 3.5, and the commmand with which I am building executables is

pyinstaller.py --onefile --clean programName.py
like image 644
Eliezer Miron Avatar asked Jul 13 '16 18:07

Eliezer Miron


1 Answers

The same happened to me when I:

  1. kept the executable opened on a Windows virtual machine;
  2. in the same time I began to rebuild the executable with Pyinstaller;
  3. then I rerun the executable and got the same message

Once I closed the application and then ran Pyinstaller, the problem dissapered.

like image 161
EnjoMitch Avatar answered Oct 18 '22 13:10

EnjoMitch