4

my py2exe setup file. I have a module that i put together, its located in project/lib/execution_timer.py(c)

i need to include that file in my build. no matter what i have tried it can not find that module. if i manually copy the file into the dist dir it works fine. but how can i automatically include this.

from distutils.core import setup
import py2exe

setup(
    console=['file.py'],
    zipfile=None,
    options={
            "py2exe":{
                    'includes': 'execution_timer'
            }    
    }
)
msw
  • 42,753
  • 9
  • 87
  • 112
M. of CA
  • 1,496
  • 2
  • 22
  • 32
  • is your setup.py in project/lib/setup.py? and you are importing execution_timer inside file.py? file.py is in the same folder? if yes to all questions, py2exe should automatically find it. – otterb Aug 26 '15 at 13:23

2 Answers2

0

I would suggest to:

  • specify the extension of the module you want to include
  • make sure that this error is not due to a relative import. It might be enough to specify also the path, if the extension of the module is not enough
Community
  • 1
  • 1
mabe02
  • 2,676
  • 2
  • 20
  • 35
0

Try this: from distutils.core import setup import py2exe

setup(
    console=['file.py'],
    zipfile=None,
    packages=['lib'],
    package_dir={'lib':'lib'},   
    }
)