Pyinstaller with Django: ModuleNotFoundError: No module named 'django.contrib.admin.apps'

Pyinstaller with Django: ModuleNotFoundError: No module named 'django.contrib.admin.apps'

我在 cmd 行中尝试 运行 我打包的 python 应用程序时遇到错误:

ModuleNotFoundError: No module named 'django.contrib.admin.apps'

我尝试了 pyinstaller 3.2 with django 1.10.1 的答案,但我仍然遇到同样的错误。唯一的区别是 ModuleNotFoundError 而不是 ImportError。有谁知道我可能做错了什么?

PyInstaller/hooks/ 位置,您应该添加挂钩文件并导入隐藏模块。

更多:https://github.com/pyinstaller/pyinstaller/issues/2332