Py2App Unable to find standard modules

I created an application using py2app that works fine, but if I zip / unzip it, the new unpacked version will not be able to access standard python modules such as traceback, or os. The manpage for zip claims to save resource plugs, and I saw other applications packaged this way (I should be able to put this in a .zip file). How to fix it?

+2
python macos py2app
source share
3 answers

This is caused by the creation of a semi-autonomous version containing symbolic links to the originally installed files, and, as you say, links are lost when zipping / unzipping, if only -y . "

An alternative solution is to create instead of a standalone one that places (public) files inside the application and thus saves zipping / unzipping, etc. better. It also means that the application is more resistant to changes in the underlying OS. The disadvantage is that it is, of course, more and more difficult to configure it.

To create a standalone version, you need to install a python.org version that you can repackage. An explanation of how to do this is here , but read the comments, as there have been some changes since writing the blog post.

+4
source share

use zip -y ... to create a file while preserving symbolic links.

0
source share

You probably need to give it the full PYTHONPATH.

Depends on your os. Here's how to find out:

import os [or any other std module] Os. file ()

0
source share

All Articles