Django with PyInstaller

0

Dear, I am trying to compile Django .exe with PyInstaller. The installation of Django and PyInstaller is fine, when I compile it also does it well:

$ pyinstaller --name=mysite mysite/manage.py

But the problem is when I want to run the .exe that I got with PyInstaller:

ejecutable.exe runserver 127.0.0.1:8000

I get this error:

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000000004BF8B70>
Traceback (most recent call last):
  File "site-packages\django\utils\autoreload.py", line 226, in wrapper
  File "site-packages\django\core\management\commands\runserver.py", line 113, in inner_run
  File "site-packages\django\utils\autoreload.py", line 249, in raise_last_exception
  File "site-packages\django\utils\six.py", line 685, in reraise
  File "site-packages\django\utils\autoreload.py", line 226, in wrapper
  File "site-packages\django\__init__.py", line 27, in setup
  File "site-packages\django\apps\registry.py", line 85, in populate
  File "site-packages\django\apps\config.py", line 116, in create
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'django.contrib.messages.apps'

I am looking for the solution but there is nothing in particular about this error, I understand that it can be part of PyInstaller, that is to say that at the moment of compiling, it did not take into account that package. I can not find the solution to this error to run the .exe without any problem.

    
asked by Nahuel Jakobson 13.05.2017 в 14:33
source

0 answers