By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

cx_freeze error when I try to include images

P: 2
When I try to build my game compiler I get error:

Expand|Select|Wrap|Line Numbers
  1. Traceback (most recent call last):
  2.   File "gamecomp.py", line 22, in <module>
  3.     executables = [exe])
  4.   File "C:\Python33\lib\site-packages\cx_Freeze\dist.py", line 365, in setup
  5.     distutils.core.setup(**attrs)
  6.   File "C:\Python33\lib\distutils\core.py", line 148, in setup
  7.     dist.run_commands()
  8.   File "C:\Python33\lib\distutils\dist.py", line 929, in run_commands
  9.     self.run_command(cmd)
  10.   File "C:\Python33\lib\distutils\dist.py", line 948, in run_command
  11.     cmd_obj.run()
  12.   File "C:\Python33\lib\distutils\command\build.py", line 126, in run
  13.     self.run_command(cmd_name)
  14.   File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
  15.     self.distribution.run_command(command)
  16.   File "C:\Python33\lib\distutils\dist.py", line 948, in run_command
  17.     cmd_obj.run()
  18.   File "C:\Python33\lib\site-packages\cx_Freeze\dist.py", line 234, in run
  19.     metadata = metadata)
  20.   File "C:\Python33\lib\site-packages\cx_Freeze\freezer.py", line 104, in __init
  21. __
  22.     self.includeFiles = self._ProcessPathSpecs(includeFiles)
  23.   File "C:\Python33\lib\site-packages\cx_Freeze\freezer.py", line 384, in _Proce
  24. ssPathSpecs
  25.     raise ConfigError("target path for include file may not be "
  26. cx_Freeze.freezer.ConfigError: target path for include file may not be an absolu
  27. te path
My compiler is:

import sys
from cx_Freeze import setup, Executable

Expand|Select|Wrap|Line Numbers
  1. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"], "include_files":["C:\Documents and Settings\boot_1.bmp", "C:\Documents and Settings\boot_2.bmp", 'C:\Documents and Settings\boot_3.bmp', 'C:\Documents and Settings\boot_4.bmp', 'C:\Documents and Settings\fish1.bmp', 'C:\Documents and Settings\fish2.bmp', 'C:\Documents and Settings\fish3.bmp', 'C:\Documents and Settings\fish4.bmp', 'C:\Documents and Settings\goldenfish_1.bmp', 'C:\Documents and Settings\goldenfish_2.bmp']}
  2.  
  3. base = None
  4. if sys.platform == "win32":
  5.     base = "Win32GUI"
  6.  
  7. exe=Executable(
  8.      script="game.py",
  9.      base=base
  10.      )
  11.  
  12. setup(  name = "Game name",
  13.         version = "1.0",
  14.         description = "My GUI application!",
  15.         options = {"build_exe": build_exe_options},
  16.         executables = [exe])
If I don't use include_files I can compile the game without any errors, but others can't play the game. How can I compile my game without errors / fix errors?
May 2 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.