I have been distributing a mac application built with py2app. For months I have received reports of users who were not able to use the application because of the error "ImportError: No module named os". I was not able to reproduce the error and was unable to help them, except to suggest they run the application from the source code.
I finally found a user (Michael) who had both the problem and the technical skills to track down the cause. > I think I have cracked the 'no module os' problem with > GanttPV.app > under 10.4. > > Assuming that the problem was with the current path, I looked at > site.py. Now I haven't done any python yet, but it is all pretty > readable; what I don't know about is the significance of the > .pyc > files - I guess I'll learn. Also, there is an alias in the > python > > folder to the site.py file in the Resources folder, but it > doesn't > seem to have to work ... > > Anyway, if you replace the line > sys.path.append(_parent + '/site-packages.zip') > > with the line > sys.path.append(_parent + '/site-packages') > > in site.py in the Resources folder of the Contents folder of the > GanttPV.app, GanttPV launching works. In my hands. > Following up on this lead we found that there is a problem with StuffIt 10. My application was distributed as a zip file so the user used StuffIt to unzip the file. It turns out that StuffIt was unzipping and deleting the site-packages.zip inside of the application! > I think we have discovered a bug (? feature?) in Stuffit. I am usng > Stuffit 10. It is set to NOT delete after unzipping, and to > continue unzipping if possible. If I turn off the latter, the > program works after unpacking. When continued unpacking is turned > on, the progam deletes the site-packages.zip file, but not the top > level zip file. As a partial work around I am not going to use .zip files to distribute my application. However, if anyone zips and then unzips the application it will stop working. Has anyone else run into this problem? _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig