首页 > 解决方案 > psycopg2.errors.SyntaxError 在或附近的“WITH ORDINALITY”与和 PostgreSQL

问题描述

我正在尝试在 Cpanel 上发布我的 django 项目,这是我的网站(http://qhse-erp.com/

我用过pip install django==2.1 --use-feature=2020-resolver

安装我所有的包,但我收到以下错误:


move_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying authtoken.0001_initial... OK
  Applying authtoken.0002_auto_20160226_1747...Traceback (most recent call last):
  File "/home/aeraeg/virtualenv/python/3.7/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.SyntaxError: syntax error at or near "WITH ORDINALITY"
LINE 6:                     FROM unnest(c.conkey) WITH ORDINALITY co...
                                                  ^
................
  File "/home/aeraeg/virtualenv/python/3.7/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/aeraeg/virtualenv/python/3.7/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: syntax error at or near "WITH ORDINALITY"
LINE 6:                     FROM unnest(c.conkey) WITH ORDINALITY co...

这是我的一些包裹

这是我安装的包的列表

Django==2.1
django-appconf==1.0.3
django-autocomplete-light==3.4.1
django-bootstrap-datepicker-plus==3.0.5
django-bootstrap4==1.0.1
django-countries==5.5
django-crispy-forms==1.8.0
django-cruds-adminlte==0.0.16
django-image-cropping==1.2.0
django-modeltranslation==0.13.4
django-rosetta==0.9.3
django-settings-export==1.2.1
django-taggit==1.1.0
django-userforeignkey==0.3.0
djangoajax==3.1
djangorestframework==3.10.3
Pillow==6.2.1
pipenv==2018.11.26
polib==1.1.0
psycopg2-binary==2.8.4
pycodestyle==2.5.0

我收到错误消息 ERROR: easy-thumbnails 2.6 requires django<2,>=1.8, 但您将拥有不兼容的 django 2.2.6。easy-thumbnails 2.6 要求枕头 <4,但您将拥有不兼容的枕头 6.2.1。

但我尝试通过许多版本卸载 django 和 Pillow 但它不是

标签: pythondjangopip

解决方案


感谢 Alsdair 的评论,我将在另一个地方询问下一个 sloution 阶段

在这里我找到了有用的笔记(由 Argo 撰写)关于

  • 删除所有迁移文件(不是迁移文件夹,保留 init.py 文件

    python manage.py makemigrations

    python manage.py migrate --fake

    python manage.py makemigrations

    python manage.py 迁移


推荐阅读