And as it turns out, docutils suffers from the same problem as sphinx
- data files located by using a module's __file__ attribute.

Anyway, I was finally able to get my app to freeze properly using two
hook modules and patching PYZOwner.getmod() in archive.py to set the
__file__ attribute of each module to a directory relative to
sys.executable. The patch is only 3 lines. If for example the module
name is "sphinx.pycode", it will set __file__ to "sys.executable/
sphinx/pycode/". The hook-* files use datas = [] to copy the files to
the proper locations.

The hook-sphinx.py and hook-docutils.py both determine the
hiddenimports and datas by examining the directory trees where they
are installed. Files that aren't python code are considered to be data
files, and inserted into datas to get copied relative to the
executable.

This process seems like it would work for any package that does this
type of thing, but I'm sure you all would be able to come up with a
better solution.

Here's my files if you're interested in taking a look: 
https://gist.github.com/991635

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to