AlexNest
@AlexNest
Работаю с Python/Django

Как правильно использовать pyinstaller для django?

Запускаю pyinstaller --name=site site/manage.py. Проект собирается.

Из dist запускаю в cmd: site.exe runserver / site.exe runserver localhost:8000:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
  File "manage.py", line 18, in main
  File "django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "django\core\management\__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "django\core\management\base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\Professional\PycharmProjects\dist\Distantinform\django\core\management\commands\runserver.py", line 61, in execute
    super().execute(*args, **options)
  File "django\core\management\base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "C:\Users\Professional\PycharmProjects\dist\Distantinform\django\core\management\commands\runserver.py", line 96, in handle
    self.run(**options)
  File "C:\Users\Professional\PycharmProjects\dist\Distantinform\django\core\management\commands\runserver.py", line 103, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "django\utils\autoreload.py", line 620, in run_with_reloader
    exit_code = restart_with_reloader()
  File "PyInstaller\hooks\rthooks\pyi_rth_django.py", line 72, in _restart_with_reloader
  File "django\utils\autoreload.py", line 246, in restart_with_reloader
    args = get_child_arguments()
  File "django\utils\autoreload.py", line 233, in get_child_arguments
    raise RuntimeError('Script %s does not exist.' % py_script)
RuntimeError: Script runserver does not exist.
[3168] Failed to execute script manage

C:\Users\Professional\PycharmProjects\dist\Distantinform>Distantinform.exe runserver localhost:8000
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
  File "manage.py", line 18, in main
  File "django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "django\core\management\__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "django\core\management\base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\Professional\PycharmProjects\dist\Distantinform\django\core\management\commands\runserver.py", line 61, in execute
    super().execute(*args, **options)
  File "django\core\management\base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "C:\Users\Professional\PycharmProjects\dist\Distantinform\django\core\management\commands\runserver.py", line 96, in handle
    self.run(**options)
  File "C:\Users\Professional\PycharmProjects\dist\Distantinform\django\core\management\commands\runserver.py", line 103, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "django\utils\autoreload.py", line 620, in run_with_reloader
    exit_code = restart_with_reloader()
  File "PyInstaller\hooks\rthooks\pyi_rth_django.py", line 72, in _restart_with_reloader
  File "django\utils\autoreload.py", line 246, in restart_with_reloader
    args = get_child_arguments()
  File "django\utils\autoreload.py", line 233, in get_child_arguments
    raise RuntimeError('Script %s does not exist.' % py_script)
RuntimeError: Script runserver does not exist.
[6184] Failed to execute script manage


То же самое из build
Error loading Python DLL 'C:\Users\Professional\PycharmProjects\build\Distantinform\python37.dll'.
LoadLibrary: ═х эрщфхэ єърчрээ√щ ьюфєы№.

Что нужно добавить, чтобы можно было запускать?
  • Вопрос задан
  • 334 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы