0

I tried to create executable of my File NewExistGUI2.py, where GUI is made using wxpython. The file depends upon other two files localsettings.py and Tryone.py. I referred to py2exe documentation, and created a setup.py file as:

from distutils.core import setup    
import py2exe
    
    setup(name = 'python eulexistdb module',
        version = '1.0',
        description = 'Python eXistdb communicator using eulexistdb module',
        author = 'Lorem Ipsum',
        py_modules = ['NewExistGUI2','localsettings','Tryone']
        )

and compiled the program in command line using

python setup.py py2exe

But I didn't got any .exe file of the main program NewExistGUI2.py in dist folder created. What Should I do now?

5
  • What was the output from python setup.py py2exe? It should tell you either what's missing, or why it did not create an exe for you. Commented Aug 29, 2013 at 15:36
  • try adding: scripts=['NewExistGUI2.py',] to your setup.py. Commented Aug 29, 2013 at 15:49
  • The output hasn't shown any error message. Its showing byte compiling python files and there is no any error. How do I tell setup.py that NewExistGUI2.py is the main file and localsettings.py, Tryone.py are accessories files. Commented Aug 29, 2013 at 15:51
  • adding scripts=['NewExistGUI2.py'] didn't worked either. also Tried to add all files into scripts but failed. Commented Aug 29, 2013 at 15:55
  • So, How can I used PyInstaller then to create EXE of the program.?? Commented Aug 29, 2013 at 16:08

1 Answer 1

1

I woul recommend you create a module (ExistGUI) with the following structure:

ExistGUI
\_ __init__.py
|_ localsettings.py
|_ Tryone.py
bin
\_ NewExistGUI2.py

Your init.py should have:

from . import localsettings, Tryone

__version__ = 1.0

Your setup.py should look something like:

from setuptools import setup, find_packages
import ExistGUI
import py2exe

setup(
     name = 'ExistGUI',
     version = ExistGUI.__version__,
     console=['bin/NewExistGUI2.py'],
     description = 'Python eXistdb communicator using eulexistdb module',
     author = 'Sarvagya Pant',
     packages= find_packages(),
     scripts=['NewExistGUI2.py',],
     py_modules = ['localsettings','Tryone'],
     include_package_data=True,
     zip_safe=False,
)

Then run python setup.py py2exe. Make sure you include any requirements for your module in setup.py. Also, remove the previously generated dist directory, just to be sure.

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.