Monty
Monty

Reputation: 245

Missing Dependencies when generating executable using py2exe

I have a problem in generating an executable from python and third party "DLL". I am using py2exe. At the end I getting a missing module error, but that module is defined in the DLL.

My Setup.py looks like this:

from distutils.core import setup
import py2exe, sys, os
import glob

setup(
    options = {'py2exe':{ "includes":["clr","openpyxl"]}},
    data_files=[('.', glob.glob('XLX2DBC.dll'))],
    windows = [{'script': "CANDBCGenerator.py"}],
    zipfile = None

)

What is the problem with this?

Upvotes: 0

Views: 1925

Answers (2)

Belial
Belial

Reputation: 851

Had a similar problem, so i switched to pyinstaller. You can install it with pip install pyinstaller. Than you use: python pyinstaller.py --onefile your_main_file.py the --onefile option will pack the dependencies into the EXE. Here is a useful post on pyinstaller: http://irwinkwan.com/2013/04/29/python-executables-pyinstaller-and-a-48-hour-game-design-compo/

Upvotes: 1

Werner
Werner

Reputation: 2096

Stopped working error could be due to the MS runtime not being found. The following wiki shows how to include them with py2exe.

http://wiki.wxpython.org/py2exe-python26

Python 2.7 uses version 9.0.30729.1 of the MS runtime, you should take them from your Python folder.

Upvotes: 0

Related Questions