how to build .exe for python 3.5+, 3.6 if possible?

Stéphane picture Stéphane · Jun 13, 2017 · Viewed 14.2k times · Source

Is there now an easy protocol to build a .exe from python 3.5+, using modules pyqtgraph, qt5, theano, pymc3, numpy, scipy, os and sys, and opening a simple GUI stored in a '.ui' file ? I lost hours and eventually failed to make one (for w7-64 bits). Help !

preliminary failure with py2exe: I first install py2exe for python 3 but it turns out this is not compatible with my python 3.6 yet, so I downgraded to python 3.5… to get a bunch of errors. Then I went to forums and tried the proposed cures but failed (I’m uneasy with windows), the alternative being to downgrade to python 3.4… So I downgraded to python 3.4 to get an error concerning a missing ‘msvcr100.dll’ that I tried to install following instructions on forums but by default I don’t have the permission to modify system directories… When I eventually had this permission it turns out the ‘regsvr32’ command fails (isn’t this for 32 bits ? but there is no ‘regsvr64’…). Following episodes are described below.


update august 23, 2017, 1pm:

what's next ?


update september, 2, 2pm:

I eventually managed to build a .exe with pyinstaller after many episodes.

Unfortunately I failed to deal with the ‘theano’ module (that is required in my case by the ‘pymc3’ module) and I had to modify the .py files and give up part of the application. Could anyone help me building a .exe for windows 7+, with the ‘theano’ module ?

see build a .exe for Windows from a python 3 script importing theano with pyinstaller

Answer

Ravi Kumar picture Ravi Kumar · Aug 30, 2017

Pyinstaller Works with Python 3.5 and it is working even for packages like tensor-flow, scipy , etc (The packages I worked with)

py -3.5 pip install pyinstaller

then go the C:\Users\user\AppData\Local\Programs\Python\Python35\Scripts and run the command

pyinstaller <code .py file along with directory> --onefile

--onefile : is for compressing the build and get a single file as output