简体   繁体   English

带有Django的Pyinstaller:ModuleNotFoundError:没有名为django.contrib.messages.apps的模块

[英]Pyinstaller with Django: ModuleNotFoundError: No Module Named django.contrib.messages.apps

I'm trying to run my packaged python application in the cmd line, and I get the error: 我试图在cmd行中运行打包的python应用程序,但出现错误:

ModuleNotFoundError: No Module Named 'django.contrib.messages.apps'

I used the answer from https://github.com/pyinstaller/pyinstaller/issues/2332 to get rid of the similar error for 'django.contrib.admin.apps' , so does anyone know how to remove this one as well? 我使用了https://github.com/pyinstaller/pyinstaller/issues/2332中的答案来摆脱'django.contrib.admin.apps'的类似错误,所以有人知道如何也删除该错误吗?

I have the same problem with Django 2.0.4 . 我对Django 2.0.4有同样的问题。 Seems like it does not supports latest versions of Django. 似乎它不支持Django的最新版本。 The problem is that PyInstaller can't resolve hidden imports, so you have to add them to hooks manually. 问题是PyInstaller无法解析隐藏的导入,因此您必须手动将它们添加到挂钩中。 Edit .spec file, which is created after first build with pyinstaller , fill array of hidden_imports with missing packages and make build pointing .spec file instead of manage.py . 编辑.spec文件,该文件是在使用pyinstaller首次构建后创建的,使用缺少的软件包填充了hidden_imports数组,并使构建指向.spec文件而不是manage.py Unfortunelly, after adding few packages, new errors appears. 不幸的是,添加了几个软件包之后,出现了新的错误。

https://pythonhosted.org/PyInstaller/when-things-go-wrong.html https://pythonhosted.org/PyInstaller/when-things-go-wrong.html

Pyinstaller works fine with Django 1.8 , so try using this version. Pyinstaller可以在Django 1.8上 Pyinstaller工作,因此请尝试使用此版本。 Project based on Django 1.8 builds successfully, and runs well using runserver 基于Django 1.8的项目可以成功构建,并且可以通过runserver运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有Django的Pyinstaller:ModuleNotFoundError:没有名为“ django.contrib.admin.apps”的模块 - Pyinstaller with Django: ModuleNotFoundError: No module named 'django.contrib.admin.apps' ModuleNotFoundError:没有名为“django.contrib.staticfilesbase”的模块 - ModuleNotFoundError: No module named 'django.contrib.staticfilesbase' Django项目的Pyinstaller错误“导入错误:没有名为'django.contrib.admin.apps'的模块” - Pyinstaller Error for Django project “ImportError: No module named 'django.contrib.admin.apps'” ModuleNotFoundError: 没有名为 'django 的模块 - ModuleNotFoundError: No module named 'django ModuleNotFoundError:没有名为“django”的模块 - ModuleNotFoundError: No module named 'django' ModuleNotFoundError: 没有名为“django”的模块 - ModuleNotFoundError: No module named ' django' Django / makemigrations ModuleNotFoundError:没有名为“idmp_core.apps.IdmpCoreConfigdjango”的模块; - Django / makemigrations ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; ModuleNotFoundError:没有名为“book”django的模块 - ModuleNotFoundError: No module named 'book' django Django ModuleNotFoundError:没有名为“设置”的模块 - Django ModuleNotFoundError: No module named 'settings' ModuleNotFoundError:Django 没有名为“tinymce”的模块 - ModuleNotFoundError: No module named 'tinymce' for Django
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM