Search code examples
pythonmatplotlibpyinstaller

Pyinstaller executable not working on some computers/laptops


I have written a program in python for data analysis. Initially, I have installed all the modules in command prompt using pip. I have used pyinstaller to make it executable and the total size was around 70 MB and the software worked on all windows 10 computers/laptops that I have tried. However, I was not happy because the plt.show() command did not have something called “Figure option” – please see the image below.

Figure 1 - matplotlib graph without Figure option Figure 1 - matplotlib graph without Figure option

When I have used anaconda prompt, I did have the “Figure option” (the arrow going up, next to the save button) but the size increased enormously to 326 MB and on some laptops it doesn’t work. So, let me explain what exactly doesn’t work: the software opens normally (it was a tkinker-based interface), but when I choose one the of the options the program closed unexpectedly without any error.

Figure 2 - matplotlib graph with Figure option Figure 2 - matplotlib graph with Figure option

Figure 3 - Figure option windows

Figure 3 - Figure option windows

The program works on the following computers:

  • 32 GB RAM Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz 2.30GHz
  • 20 GB RAM Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz 3.60GHz On the followings it doesn’t work:
  • 32 GB RAM Intel® Core™ i7-1065G7 CPU @ 1.30GHz 1.50 GHz
  • 8 GB RAM, Intel® Core™ i7-4600U CPU @ 2.10 GHz 2.70 GHz

Please let me know if something is unclear and I will try to reformulate. Thank you for your help!

PS: I know that is not indicated to use a virtual environment like miniconda, but I don’t know other option how to have the “Figure option” present after plt.show().


Solution

  • I have noticed that the problem can be easily solved by installing Miniconda then matplotlib for Anaconda prompt terminal.