pygame - Compiled python script returns WindowsError: [Error 3] after using py2exe -


so have been writing game while , have finished. due fact game meant class , used libraries teacher isn't going bother installing need make single executable run independent of python , games dependencies. ran py2exe , completed when run exe error:

traceback (most recent call last):   file "main.pyw", line 1, in <module>   file "zipextimporter.pyo", line 82, in load_module   file "libs\__init__.pyo", line 3, in <module> windowserror: [error 3] system cannot find path specified: 'c:\\users\\matt\\workspace\\cos125\\src\\dist\\includes.zip\\libs/*.*' 

i have figured out cause of error is. stems auto importer have installed each package. in init.py files packages use following code simple "from libs import *" import files in lib package. make each file loaded if loaded each 1 "from libs.module import *".

the code in init file follows:

import os, sys path = os.path.dirname(__file__) dirlist = os.listdir(path) mod in dirlist:     ext = os.path.splitext(mod)     mod = mod[:-len(ext[1])]     if (mod not in dir() ,          mod != "__init__" ,         mod != "" ,         mod != "._"):         exec("from " + mod + " import *") 

essentially asking if else knows how without resulting in error after compiling?

i think ran similar problem couple years ago, , solved getting rid of zip files in distribution.

with py2exe options, try setting zipfile=none or maybe turn off compression , turn off bundling.

note creating windows exe run on windows os's pain. got feedback on py2exe list here , here.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -