0

I keep getting this error when trying to do a build on Win 7 64bit:

C:\Users\Tom>python C:\Users\Tom\Documents\setup.py build
running build
running build_exe
copying C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\bases\Win32GUI.exe ->
build\exe.win32-2.7\NJM_GUI.exe
copying C:\Users\Tom\Anaconda\python27.dll -> build\exe.win32-2.7\python27.dll
Stamped: build\exe.win32-2.7\NJM_GUI.exe
Traceback (most recent call last):
File "C:\Users\Tom\Documents\setup.py", line 29, in <module>
executables=executables
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\dist.py", line 362, in
setup
distutils.core.setup(**attrs)
File "C:\Users\Tom\Anaconda\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Users\Tom\Anaconda\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Users\Tom\Anaconda\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Tom\Anaconda\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Users\Tom\Anaconda\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\Tom\Anaconda\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\dist.py", line 232, in
run
freezer.Freeze()
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\freezer.py", line 610,
in Freeze
self.compress, self.copyDependentFiles)
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\freezer.py", line 510,
in _WriteModules
module.Create(finder)
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\freezer.py", line 746,
in Create
module.file, module.name)
cx_Freeze.freezer.ConfigError: no file named sys (for module boto.compat.sys)

my setup.py file looks like:

import sys
from cx_Freeze import setup, Executable

base = None
if sys.platform == 'win32':
base = 'Win32GUI'

options = {
    'build_exe': {
        'includes': 'atexit'
    }
}

executables = [
    Executable('C:\Users\Tom\Documents\NJM_GUI.py', base=base)
]

setup(name='simple_PyQt4',
  version='0.1',
  description='Sample cx_Freeze PyQt4 script',
  options=options,
  executables=executables
  )

I do use numpy and pandas in my app as well as pyqt but not sure what the issue is here or how to resolve it?

Thanks.

Tom
  • 251
  • 1
  • 6
  • 16

1 Answers1

0

The full detailed answer is at cx_freeze fails to create exe with pandas library.

The short version is exclude the following files:

'build_exe': {
    'excludes': ['boto.compat.sys',
                 'boto.compat._sre',
                 'boto.compat._json',
                 'boto.compat._locale',
                 'boto.compat._struct',
                 'boto.compat.array'],
}
Community
  • 1
  • 1
Brandon W. King
  • 188
  • 1
  • 10