0

I have a python project which has to be exported in to an executable file so that it can be used in other systems as well. The project has its UI in a browser and runs on localhost.

So far I have tried PyInstaller and cx_Freeze but to no success. I encountered some errors with PyInstaller which I was unable to solve and I switched to cx_Freeze. I was able to freeze the scripts and create a .exe file. But when I open(double click) the .exe file, I get nothing. Not even an error message. I tried running it from command prompt as well, but there too I got no message or output.

Can anyone suggest how my objective can be achieved? Or something needs to be checked?

Here is my setup.py

import sys
import os
from cx_Freeze import setup, Executable

base = None
#if sys.platform == "win32":
#   base = "Win32GUI"

os.environ['TCL_LIBRARY']="C:\\Users\\M******\\AppData\\Local\\Continuum\\Anaconda3\\tcl\\tcl8.6"
os.environ['TK_LIBRARY']="C:\\Users\\M******\\AppData\\Local\\Continuum\\Anaconda3\\tcl\\tk8.6"


setup ( name = "Network Analysis",
        version = "0.1",
        description = "Network Analysis Project",
        options = { "build_exe": { "packages" : ['encodings','asyncio','pandas','numpy','geopy','networkx','configparser','json']}},
        executables = [Executable("run.py",base=base)])
  • How about you include your setup script and maybe an example so we can test everything ourselves (and at least know what you are doing). – Xantium Jan 02 '18 at 18:53
  • If you got no error when building, then I don't have a clue – Xantium Jan 02 '18 at 21:13
  • There was a fatal error for Intel_MKL dll which popped up when I followed the suggestion in this post https://stackoverflow.com/questions/12791666/after-creating-python-exe-file-with-cx-freeze-the-file-doesnt-do-anything . And this fatal error was solved when I placed mkl_intel_thread.dll file in the same folder as the generated exe. – Shanmukha Sampath Kumar Jan 03 '18 at 06:13
  • Now the problem is that, the project structure is not as expected and the modules that were written by me are not getting compiled. I mean, the .pyc files for the modules which I have written are not getting generated. Do I need to add something in the setup.py? – Shanmukha Sampath Kumar Jan 03 '18 at 06:15
  • I don't have a clue. Sorry. – Xantium Jan 07 '18 at 17:15
  • pyinstaller handled my code without any customization. I was buffaloed, after the pains using py2exe back in the day. No additional scripts required. – RufusVS Jun 27 '18 at 03:15

0 Answers0