I am trying to create a small .exe file for a sponsor. The python code performs calculations that use the numpy library, specifically numpy arrays. When I compile the code with pyinstaller, the exe file is relatively large (250 MB). But when I try to get rid of numpy and perform similar calculations using only lists and basic operations, the file is only 20 MB.
I tried using tricks like upx but it didn't do much.
Is there a way to import essential modules from numpy without generating a huge file. I just need simple stuff such as array representation, np.diff(), and np.interp().
Thanks!
I am trying to create a small .exe file for a sponsor. The python code performs calculations that use the numpy library, specifically numpy arrays. When I compile the code with pyinstaller, the exe file is relatively large (250 MB). But when I try to get rid of numpy and perform similar calculations using only lists and basic operations, the file is only 20 MB.
I tried using tricks like upx but it didn't do much.
Is there a way to import essential modules from numpy without generating a huge file. I just need simple stuff such as array representation, np.diff(), and np.interp().
Thanks!
Share Improve this question asked Feb 15 at 21:22 Quentin PLOUSSARDQuentin PLOUSSARD 313 bronze badges 8 | Show 3 more comments1 Answer
Reset to default 0Alright, nomkl defintely improved things, even when importing the entire numpy, pandas, and matplotlib package in the code.
Here is the yml I used to set up the environment in conda:
name: my_env
channels:
- defaults
dependencies:
- pyinstaller
- pip
- pip:
- nomkl
- numpy
- matplotlib
- ortools=9.11.4210
np.dot
and linear algebra functions using it internally. – Jérôme Richard Commented Feb 16 at 0:26