Pyintsaller Execuatble RuntimeError: Script runserver not found

Pyintsaller Execuatble RuntimeError: Script runserver not found

我使用 Pyinstaller 在 Linux 上创建了一个 Django 应用程序可执行文件“testrun”。

然后我使用命令dist/testrun/testrun runserver: localserver:8000来测试可执行文件。但是报错信息显示:

RuntimeError: Script runserver not found

Spec file hiddenimport used for executable building

Executable Runtime Error Message

问题已解决:Pyinstaller 目前不能很好地支持 Django 3.x.x 版本。卸载 Django 并下载 Django 2.2.16 版本。然后使用 pyinstaller 创建可执行文件。可执行文件现在可以正常工作了。

最后加上--noreload,不用降级django就可以解决这个问题

dist/testrun/testrun runserver --noreload