Pyinstaller with Django: ModuleNotFoundError: No Module Named django.contrib.messages.apps
Pyinstaller with Django: ModuleNotFoundError: No Module Named django.contrib.messages.apps
我正在尝试 运行 我在 cmd 行中打包的 python 应用程序,但出现错误:
ModuleNotFoundError: No Module Named 'django.contrib.messages.apps'
我使用 https://github.com/pyinstaller/pyinstaller/issues/2332 的答案来消除 'django.contrib.admin.apps'
的类似错误,所以有人知道如何删除这个错误吗?
我和 Django 2.0.4
有同样的问题。似乎它不支持最新版本的 Django。问题是 PyInstaller 无法解析隐藏的导入,因此您必须手动将它们添加到挂钩中。编辑 .spec
文件,该文件是在使用 pyinstaller
首次构建后创建的,用缺少的包填充 hidden_imports
的数组,并使构建指向 .spec
文件而不是 manage.py
。不幸的是,添加了几个包后,出现了新的错误。
https://pythonhosted.org/PyInstaller/when-things-go-wrong.html
Pyinstaller
适用于 Django 1.8,因此请尝试使用此版本。基于Django 1.8的项目构建成功,使用runserver
运行良好
我正在尝试 运行 我在 cmd 行中打包的 python 应用程序,但出现错误:
ModuleNotFoundError: No Module Named 'django.contrib.messages.apps'
我使用 https://github.com/pyinstaller/pyinstaller/issues/2332 的答案来消除 'django.contrib.admin.apps'
的类似错误,所以有人知道如何删除这个错误吗?
我和 Django 2.0.4
有同样的问题。似乎它不支持最新版本的 Django。问题是 PyInstaller 无法解析隐藏的导入,因此您必须手动将它们添加到挂钩中。编辑 .spec
文件,该文件是在使用 pyinstaller
首次构建后创建的,用缺少的包填充 hidden_imports
的数组,并使构建指向 .spec
文件而不是 manage.py
。不幸的是,添加了几个包后,出现了新的错误。
https://pythonhosted.org/PyInstaller/when-things-go-wrong.html
Pyinstaller
适用于 Django 1.8,因此请尝试使用此版本。基于Django 1.8的项目构建成功,使用runserver