filers.py中的import django_过滤器显示“import”django_过滤器“无法解析DylanCereportMissingImports”

gudnpqoy  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(202)

我已经尝试在其他线程中寻找解决方案,但仍然坚持解决这个问题。
我的python版本是3.9.5;我将django重新安装到较低版本(它是3.2.0,后来安装了3.0)

INSTALLED_APPS = [
      ...
      ...
     'django_filters',
    ]

错误

Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "c:\users\anika tabassum era\appdata\local\programs\python\python
line 954, in _bootstrap_inner
    self.run()
  File "c:\users\anika tabassum era\appdata\local\programs\python\python
line 892, in run
    self._target(*self._args,**self._kwargs)
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\utils\au in wrapper
    fn(*args,**kwargs)
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\core\manrver.py", line 110, in inner_run
    autoreload.raise_last_exception()
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\utils\au in raise_last_exception
    raise _exception[1]
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\core\man
line 375, in execute
    autoreload.check_errors(django.setup)()
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\utils\au in wrapper
    fn(*args,**kwargs)
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\__init__p
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\apps\reg populate
    app_config = AppConfig.create(entry)
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django\apps\con
create
    import_module(entry)
  File "c:\users\anika tabassum era\appdata\local\programs\python\python    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlo
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_modul
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_r
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django_filters\
in <module>
  File "D:\DJPROJ\FINALS\DennisCRM\env\lib\site-packages\django_filters\, in <module>
    from django.utils import six
ImportError: cannot import name 'six' from 'django.utils' (D:\DJPROJ\FINsite-packages\django\utils\__init__.py)

安装为 pip install django-filter . 在my filters.py中,我得到一行import django_filters,黄色下划线,悬停显示import“django_filters”无法解析
谁能给我带路吗?谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题