InviteBox / django-live-profiler

A database access profiler for Django-based applications that can be ran in production
193 stars 44 forks source link

ImportError while running django server: cannot import name 'empty_iter' from 'django.db.models.sql.compiler' #30

Open savvagen opened 3 years ago

savvagen commented 3 years ago

Got an exception while running libe profiler(0.0.9) with Django==2.2.17

(venv) savva.genchevskiy@NB072 src % python manage.py runserver --noreload --nothreading
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/profiler/models.py", line 5, in <module>
    from profiler.instrument import *
  File "/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/profiler/instrument.py", line 3, in <module>
    from django.db.models.sql.compiler import SQLCompiler, empty_iter
ImportError: cannot import name 'empty_iter' from 'django.db.models.sql.compiler' (/Users/savva.genchevskiy/PycharmProjects/django-profiling-poc/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py)