dbv píše v St 20. 03. 2013 v 16:23 -0700:
> What is the best practice for finding modules to satisfy hidden
Could you please specify what you mean by 'hidden imports'?
- imports that pyinstaller is not able find by default or
- all imports that pyinstaller is able to find?
> Spent time understanding mf.py only to find out it is no longer
> available in pyinstaller.
There is no longer available file mf.py. However, its code is still
present there. The code and file structure was just refactored.
The mf.py code is mostly in ./PyInstaller/depend/imptracker.py.
> The ideal solution is to pass all the source files to the module
> finder which then outputs the necessary hidden imports.
The ideal solution would be to use python library 'modulegraph' for
module dependency analysis. Modulegraph works the way you described: You
pass all source modules to modulegraph which then outputs the necessary
- For python3 support I would like to use modulegraph for import
- I started some work on it in ./PyInstaller/depend/build.py. Look for
function 'assemble_modulegraph' in that file.
There will be always some cases where pyinstaller will not be able to
find proper import dependencies and for these cases
- there are import hooks
- some other heuristic would be necessary
One example, where it is hard to detect dependencies are Python C/C++
- one heuristic in that case could be to import C extension in a python
subprocess and get the difference of 'sys.modules.keys()' before and
Referring to imports that pyinstaller is not able to find by default.
Traced problem to werkzeug which has been documented at http://www.pyinstaller.org/ticket/602 and using the published workaround in the interim. Seems to be a wekzeug problem - (https://github.com/mitsuhiko/flask/issues/589#issuecomment-9208197 and https://github.com/mitsuhiko/werkzeug/issues/221)
Will definitely look at the Python modulegraph. Thx.
dbv píše v Čt 21. 03. 2013 v 08:56 -0700:
> Will definitely look at the Python modulegraph. Thx.
My brief experiments showed that for example modulegraph is able to find
zope.interface properly where pyinstaller is lacking. 'zope' is a
namespace package - the 'zope' directory does not contain __init__.py