Reputation: 430
When running an executable file, my program crashes when processing a large file. The crash doesn't happen with small files, which get processed without problems. The weird thing is that the program works just fine outside of pyinstaller. I have tried building with console from a command prompt and debug outputs, but still nothing is printed.
Important to note here, is that the executable works well on other PC's (with the same files). It's not entirely clear what the difference is between these PC's. It could be memory, but during the crash there's not a lot of memory in use by the program. It could be dependencies under the hood, but I thought pyinstaller would take care of these.
The line that the program crashes on is a read_csv call.
df = pd.read_csv(filename, sep=',', low_memory=False)
Here, the low_memory doesn't really matter, the crash happens either way. There isn't any error with the separator either, since this would print an error and works fine outside pyinstaller.
I read somewhere that there might still be some dll's missing, would these give errors? Since I already fixed some of these by including them inside the .spec file that I create the .exe with.
This is not a duplicate question, since this question is specific to pygame. Interesting question that didn't fix my problem.
Upvotes: 0
Views: 1527
Reputation: 430
The issue was with memory. This line was fixed by reading the file in chunks.
chunksize = 10000
chunk_red = pd.read_csv(self.red_path, sep=',', chunksize=chunksize,
names=colnames, header=None)
red_df = pd.concat(chunk_red, ignore_index=True)
I now have the same problem at another line where I try to match points to their nearest neighbour using KD trees though, this uses even more memory and can't really be chunked up.
Upvotes: 1