【问题标题】:Geonode paver setup not setting geonode correctlyGeonode摊铺机设置未正确设置geonode
【发布时间】:2021-03-24 04:23:53
【问题描述】:

当我遇到摊铺机设置说明时,我正在安装 geonode。它运行不正常。给出的错误信息如下图。

(geonode) eidul@eidul-Virtual-Machine:/opt/geonode$ paver setup
free(): invalid pointer
Traceback (most recent call last):
  File "/home/eidul/.virtualenvs/geonode/bin/paver", line 8, in <module>
    sys.exit(main())
  File "/home/eidul/.virtualenvs/geonode/lib/python3.8/site-packages/paver/tasks.py", line 890, in main
    _launch_pavement(args)
  File "/home/eidul/.virtualenvs/geonode/lib/python3.8/site-packages/paver/tasks.py", line 858, in _launch_pavement
    exec(compile(source, environment.pavement_file, 'exec'), mod.__dict__)
  File "pavement.py", line 62, in <module>
    from geonode.settings import (
  File "/opt/geonode/geonode/settings.py", line 115, in <module>
    spatialite_version = int(spatialite_proc.stdout.decode()[0])
IndexError: string index out of range

【问题讨论】:

    标签: python django gis


    【解决方案1】:

    spatialite 不再受支持。请使用启用 Postgis 的 Postgres

    【讨论】:

      【解决方案2】:

      正如@Mattia 所说,spatialite 不再受支持。 如果您已经使用 postgis 配置了 postgres 并且仍然收到错误。您可以按如下方式更改 settings.py(不推荐)

      更改此部分并添加您的 DATABASE_URL

      # add trailing slash to site url. geoserver url will be relative to this
      if not SITEURL.endswith('/'):
      SITEURL = f'{SITEURL}/'
      
      _DB_PATH = os.path.join(PROJECT_ROOT, 'development.db')
      
      DATABASE_URL = os.getenv(
      'DATABASE_URL')
      
      #if DATABASE_URL.startswith("spatialite"):
      #try:
      #spatialite_proc = subprocess.run(["spatialite", "-version"],     stdout=subprocess.PIPE)
      #spatialite_version = int(spatialite_proc.stdout.decode()[0]) 
      #if spatialite_version < 5:
              # To workaround Shapely/Spatialite interaction bug for Spatialite < 5
      #        from shapely import speedups
      #       speedups.enable()
      #except FileNotFoundError as ex:
      #   print(ex)
      
      # DATABASE_URL = 'postgresql://test_geonode:test_geonode@localhost:5432/geonode'
      
      DATABASE_URL='postgis://geonode:geonode@localhost:5432/geonode'
      

      建议使用您自己的设置文件。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-02-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多