Pyinstaller executable crashes on some laptops/computers

750 views
Skip to first unread message

Gianga Tiberiu

unread,
Apr 9, 2021, 8:20:30 AM4/9/21
to PyInstaller

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

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 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().

bwoodsend

unread,
Apr 10, 2021, 10:08:52 AM4/10/21
to PyInstaller

The silent crash sounds like the Conda NumPy bug caused by a missing OpenMP library. If you run your PyInstaller built application from an Anaconda prompt it is able to use the original copy from your Conda installation so you don’t realise it’s broken until you either run from plain command prompt (deactivating the virtual environment is not enough) or try running it on another machine. Also the OpenMP library is quite common so some computers may have it anyway - making it even harder to diagnose.

The solution is either to install NumPy with pip or install PyInstaller from Github which has a fix for it which isn’t yet released.

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

Using pip’s NumPy and matplotlib should also help reduce the size. In either case, make sure you add --clean next time you run PyInstaller.

Gianga Tiberiu

unread,
Apr 25, 2021, 5:23:36 AM4/25/21
to pyins...@googlegroups.com
Hi,

I have solved the problem by installing Miniconda and then from Anaconda prompt matplotlib was installed.


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/3655c9a4-32f3-4994-9ca5-2290ed56dcf1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages