Pyinstaller executable crashes on some laptops/computers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pyinstaller executable crashes on some laptops/computers

Gianga Tiberiu

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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/f1aad628-ab38-43f6-9bb0-49163f35ea2an%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Pyinstaller executable crashes on some laptops/computers

bwoodsend

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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/3655c9a4-32f3-4994-9ca5-2290ed56dcf1n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Pyinstaller executable crashes on some laptops/computers

Gianga Tiberiu
Hi,

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


On Sat, Apr 10, 2021 at 3:08 PM bwoodsend <[hidden email]> wrote:

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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/3655c9a4-32f3-4994-9ca5-2290ed56dcf1n%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CAFHJQCTo6CbdVyAtD9zLJZCXx%3DQN%3D%2B7tdz_gkuu_enNqXBEoVg%40mail.gmail.com.