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