编译Django应用程序时出现Pyinstaller错误

时间:2019-01-23 10:25:10

标签: pyinstaller

我正在尝试编译使用通道2.1.5软件包的django应用程序。

当我运行Pyinstaller时,出现以下错误,我想了解它们的含义以及解决方法。


35655 INFO: Import to be excluded not found: 'tkinter'
35655 INFO: Loading module hook "hook-django.db.backends.py"...
36962 WARNING: Hidden import "django.db.backends.__pycache__.base" not found!
36963 INFO: Loading module hook "hook-django.py"...
Traceback (most recent call last):
  File "<string>", line 41, in <module>
  File "<string>", line 36, in walk_packages
  File "<string>", line 36, in walk_packages
  File "<string>", line 20, in walk_packages
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\admin\__init__.py", line 5, in <module>
    from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\admin\options.py", line 2, in <module>
    from django.contrib.gis.admin.widgets import OpenLayersWidget
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\admin\widgets.py", line 3, in <module>
    from django.contrib.gis.gdal import GDALException
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\gdal\__init__.py", line 28, in <module>
    from django.contrib.gis.gdal.datasource import DataSource
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\gdal\datasource.py", line 39, in <module>
    from django.contrib.gis.gdal.driver import Driver
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\gdal\driver.py", line 5, in <module>
    from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\gdal\prototypes\ds.py", line 9, in <module>
    from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
  File "c:\users\nissan\anaconda3\lib\site-packages\django\contrib\gis\gdal\libgdal.py", line 43, in <module>
    % '", "'.join(lib_names)
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal202", "gdal201", "gdal20", "gdal111", "gdal110", "gdal19"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
39231 INFO: Determining a mapping of distributions to packages...
129059 INFO: Packages required by django:
['pytz']
129059 INFO: Django root directory C:\git\CoreTigo_IOLWM_Gateway_WebApp\gateway\backend\src\cfehome
Traceback (most recent call last):
  File "c:\users\nissan\anaconda3\lib\site-packages\PyInstaller\utils\hooks\subproc\django_import_finder.py", line 37, in <module>
    list(settings.TEMPLATE_LOADERS) + \
  File "c:\users\nissan\anaconda3\lib\site-packages\django\conf\__init__.py", line 58, in __getattr__
    val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'
131137 INFO: Collecting Django migration scripts.

以下是警告的摘要:

  1. 36962警告:找不到隐藏的导入“ django.db.backends。 pycache .base”!
  2. django.core.exceptions.ImproperlyConfigured:找不到GDAL库(尝试“ gdal202”,“ gdal201”,“ gdal20”,“ gdal111”,“ gdal110”,“ gdal19”)。是否安装了GDAL?如果是这样,请尝试在设置中设置GDAL_LIBRARY_PATH。
  3. AttributeError:“设置”对象没有属性“ TEMPLATE_CONTEXT_PROCESSORS”

谢谢。

0 个答案:

没有答案