简体   繁体   中英

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:

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?

I have the same problem with Django 2.0.4 . Seems like it does not supports latest versions of Django. The problem is that PyInstaller can't resolve hidden imports, so you have to add them to hooks manually. 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 . Unfortunelly, after adding few packages, new errors appears.

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

Pyinstaller works fine with , so try using this version. Pyinstaller工作,因此请尝试使用此版本。 Project based on Django 1.8 builds successfully, and runs well using runserver

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM