我想创建一个可执行文件来运行我的django服务器。我的目录结构类似于this。
当我在命令行上使用以下命令时:
C:\Users\Dell\Desktop\dist\Barcode>pyinstaller --name=Barcode --noupx Barcode/manage.py
显示:
144 INFO: PyInstaller: 3.2
144 INFO: Python: 2.7.11
146 INFO: Platform: Windows-8.1-6.3.9600
147 INFO: wrote C:\Users\Dell\Desktop\Barcode.spec
148 INFO: UPX is not available.
151 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Dell\\Desktop\\Barcode', 'C:\\Users\\Dell\\Desktop']
151 INFO: checking Analysis
151 INFO: Building Analysis because out00-Analysis.toc is non existent
153 INFO: Initializing module dependency graph...
156 INFO: Initializing module graph hooks...
207 INFO: running Analysis out00-Analysis.toc
210 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable required by f:\python27\python.exe
470 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_8550c6b5d18a9128.manifest
472 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4137_none_f47d3254f657e518.manifest
473 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_f47e1bd6f6571810.manifest
473 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_f480bfaef65491a5.manifest
476 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_f4823b16f6535909.manifest
719 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.8387_none ...
719 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb.manifest
720 INFO: Searching for file msvcr90.dll
722 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\msvcr90.dll
722 INFO: Searching for file msvcp90.dll
722 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\msvcp90.dll
722 INFO: Searching for file msvcm90.dll
723 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\msvcm90.dll
934 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_8550c6b5d18a9128.manifest
934 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4137_none_f47d3254f657e518.manifest
936 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_f47e1bd6f6571810.manifest
937 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_f480bfaef65491a5.manifest
939 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_f4823b16f6535909.manifest
940 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,30729, 8387)
5506 INFO: Caching module hooks...
5512 INFO: Analyzing C:\Users\Dell\Desktop\Barcode\manage.py
8725 INFO: Processing pre-find module path hook distutils
8936 INFO: Processing pre-safe import module hook _xmlplus
12565 INFO: Loading module hooks...
12565 INFO: Loading module hook "hook-distutils.py"...
12567 INFO: Loading module hook "hook-sysconfig.py"...
12568 INFO: Loading module hook "hook-django.core.management.py"...
13674 INFO: Excluding import 'IPython'
13677 WARNING: Removing import django.core.management.commands.shell from module IPython
13677 WARNING: Removing import django.core.management.commands.shell from module IPython.IPShell
13677 WARNING: Removing import django.core.management.commands.shell from module IPython.start_ipython
13680 INFO: Excluding import 'Tkinter'
13683 INFO: Import to be excluded not found: 'matplotlib'
13684 INFO: Loading module hook "hook-xml.py"...
13684 INFO: Loading module hook "hook-PIL.py"...
13687 INFO: Excluding import 'FixTk'
13690 INFO: Excluding import 'Tkinter'
13693 INFO: Excluding import 'PyQt5'
13696 WARNING: Removing import PIL.ImageQt from module PyQt5
13696 WARNING: Removing import PIL.ImageQt from module PyQt5.qRgba
13697 WARNING: Removing import PIL.ImageQt from module PyQt5.QPixmap
13697 WARNING: Removing import PIL.ImageQt from module PyQt5.QImage
13697 INFO: Excluding import 'PySide'
13700 WARNING: Removing import PIL.ImageQt from module PySide.QPixmap
13700 WARNING: Removing import PIL.ImageQt from module PySide.qRgba
13700 WARNING: Removing import PIL.ImageQt from module PySide
13702 WARNING: Removing import PIL.ImageQt from module PySide.QImage
13702 INFO: Excluding import 'PyQt4'
13705 WARNING: Removing import PIL.ImageQt from module PyQt4.qRgba
13705 WARNING: Removing import PIL.ImageQt from module PyQt4
13706 WARNING: Removing import PIL.ImageQt from module PyQt4.QImage
13706 WARNING: Removing import PIL.ImageQt from module PyQt4.QPixmap
13707 INFO: Loading module hook "hook-django.db.backends.py"...
14169 INFO: Loading module hook "hook-httplib.py"...
14170 INFO: Loading module hook "hook-_tkinter.py"...
15023 INFO: checking Tree
15023 INFO: Building Tree because out00-Tree.toc is non existent
15023 INFO: Building Tree out00-Tree.toc
15210 INFO: checking Tree
15212 INFO: Building Tree because out01-Tree.toc is non existent
15212 INFO: Building Tree out01-Tree.toc
15236 INFO: Loading module hook "hook-django.db.backends.oracle.base.py"...
15240 INFO: Loading module hook "hook-PIL.Image.py"...
15591 INFO: Loading module hook "hook-xml.dom.domreg.py"...
15592 INFO: Loading module hook "hook-pkg_resources.py"...
15890 INFO: Loading module hook "hook-django.db.backends.mysql.base.py"...
15893 INFO: Loading module hook "hook-django.core.mail.py"...
15950 INFO: Loading module hook "hook-pytz.py"...
15956 INFO: Loading module hook "hook-django.template.loaders.py"...
16051 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
16054 INFO: Excluding import 'FixTk'
16057 INFO: Excluding import 'Tkinter'
16059 INFO: Loading module hook "hook-encodings.py"...
16463 INFO: Loading module hook "hook-sqlite3.py"...
16469 INFO: Loading module hook "hook-django.py"...
16470 INFO: Django root directory C:\Users\Dell\Desktop\Barcode\Barcode
17785 INFO: Collecting Django migration scripts.
18818 INFO: Processing pre-safe import module hook six.moves
18995 WARNING: Hidden import "Entry.templatetags" not found!
18996 WARNING: Hidden import "item_list.templatetags" not found!
18996 WARNING: Hidden import "django.contrib.contenttypes.context_processors" not found!
19005 WARNING: Hidden import "django.template.context_processors.media" not found!
19015 WARNING: Hidden import "crispy_forms.context_processors" not found!
19023 WARNING: Hidden import "django.template.context_processors.tz" not found!
19023 WARNING: Hidden import "django.contrib.auth.templatetags" not found!
19157 WARNING: Hidden import "django.contrib.contenttypes.templatetags" not found!
19167 WARNING: Hidden import "item_list.context_processors" not found!
19167 WARNING: Hidden import "django.contrib.messages.context_processors.messages" not found!
19269 WARNING: Hidden import "django.contrib.admin.context_processors" not found!
19289 WARNING: Hidden import "django.template.context_processors.i18n" not found!
19358 WARNING: Hidden import "django.contrib.sessions.context_processors" not found!
19360 WARNING: Hidden import "django.contrib.staticfiles.context_processors" not found!
19480 WARNING: Hidden import "django.contrib.messages.templatetags" not found!
19482 WARNING: Hidden import "django.template.context_processors.static" not found!
19482 WARNING: Hidden import "exit.templatetags" not found!
19607 WARNING: Hidden import "django.template.loaders.filesystem.Loader" not found!
19654 WARNING: Hidden import "django.contrib.sessions.templatetags" not found!
19654 WARNING: Hidden import "Entry.context_processors" not found!
19716 WARNING: Hidden import "django.template.context_processors.debug" not found!
19716 WARNING: Hidden import "django.contrib.auth.context_processors.auth" not found!
19717 WARNING: Hidden import "supplier.templatetags" not found!
19717 WARNING: Hidden import "django.template.loaders.app_directories.Loader" not found!
19720 WARNING: Hidden import "exit.context_processors" not found!
19861 WARNING: Hidden import "supplier.context_processors" not found!
20028 INFO: Loading module hook "hook-django.core.cache.py"...
20064 INFO: Loading module hook "hook-django.contrib.sessions.py"...
20792 INFO: checking Tree
20794 INFO: Building Tree because out02-Tree.toc is non existent
20794 INFO: Building Tree out02-Tree.toc
21019 INFO: Looking for ctypes DLLs
21042 INFO: Analyzing run-time hooks ...
21055 INFO: Including run-time hook 'pyi_rth_pkgres.py'
21058 INFO: Including run-time hook 'pyi_rth__tkinter.py'
21059 INFO: Including run-time hook 'pyi_rth_django.py'
21090 INFO: Looking for dynamic libraries
41651 WARNING: Attempted to add Python module twice with different upper/lowercases: PIL._webp
41651 WARNING: Attempted to add Python module twice with different upper/lowercases: PIL._imagingtk
41651 WARNING: Attempted to add Python module twice with different upper/lowercases: PIL._imaging
41651 WARNING: Attempted to add Python module twice with different upper/lowercases: PIL._imagingft
41653 INFO: Looking for eggs
41653 INFO: Using Python library C:\Windows\system32\python27.dll
41653 INFO: Found binding redirects: [BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 8387), publicKeyToken=u'1fc8b3b9a1e18e3b')]
41677 INFO: Warnings written to C:\Users\Dell\Desktop\build\Barcode\warnBarcode.txt
43134 INFO: checking PYZ
43134 INFO: Building PYZ because out00-PYZ.toc is non existent
43134 INFO: Building PYZ (ZlibArchive) C:\Users\Dell\Desktop\build\Barcode\out00-PYZ.pyz
45653 INFO: checking PKG
45654 INFO: Building PKG because out00-PKG.toc is non existent
45654 INFO: Building PKG (CArchive) out00-PKG.pkg
45809 INFO: Bootloader f:\python27\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
45809 INFO: checking EXE
45809 INFO: Building EXE because out00-EXE.toc is non existent
45809 INFO: Building EXE from out00-EXE.toc
45809 INFO: Appending archive to EXE C:\Users\Dell\Desktop\build\Barcode\Barcode.exe
45835 INFO: checking COLLECT
45835 INFO: Building COLLECT because out00-COLLECT.toc is non existent
45837 INFO: Building COLLECT out00-COLLECT.toc
45875 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 8387)
我觉得问题可能是隐藏的导入部分,但我不确定如何解决它,因为当我运行由此形成的exe时,它给出了:
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\Users\\Dell\\AppData\\Local\\Temp\\_MEI85~1\\Entry\\migrations/*.*'