gpt4 book ai didi

python - 无法运行 python manage.py 检查

转载 作者:太空宇宙 更新时间:2023-11-03 21:24:11 24 4
gpt4 key购买 nike

当我运行上述命令时,我得到

python3 manage.py check  
Traceback (most recent call last):
File "manage.py", line 16, in <module>
execute_from_command_line(sys.argv)
File "~/.local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "~/.local/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "~/.local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "~/.local/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
app_config.import_models()
File "~/.local/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "~/src/lavoro-fabio/places/models.py", line 2, in <module>
from django.contrib.gis.db import models as g
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
import django.contrib.gis.db.models.functions # NOQA
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/db/models/functions.py", line 4, in <module>
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/forms/fields.py", line 2, in <module>
from django.contrib.gis.geos import GEOSException, GEOSGeometry
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/geos/__init__.py", line 5, in <module>
from .collections import ( # NOQA
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/geos/collections.py", line 9, in <module>
from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/geos/geometry.py", line 8, in <module>
from django.contrib.gis import gdal
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/datasource.py", line 41, in <module>
from django.contrib.gis.gdal.layer import Layer
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/layer.py", line 6, in <module>
from django.contrib.gis.gdal.feature import Feature
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/feature.py", line 4, in <module>
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
File "~/.local/lib/python3.6/site-packages/django/contrib/gis/gdal/geometries.py", line 52, in <module>
from django.contrib.gis.geometry import hex_regex, json_regex, wkt_regex
ImportError: cannot import name 'hex_regex'

安装以下requirements.txt后:

Django>=2.0
django-leaflet
django-geo
psycopg2 --no-binary psycopg2

我一直希望不会出现错误,因为我过去已经运行过检查而没有错误。django 的版本为 2.1.4

最佳答案

在我将项目迁移到使用 pipelinenv 并运行 pipenv run python3 manage.py check 后,问题得到解决

关于python - 无法运行 python manage.py 检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53971173/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com