0

I'm getting this warning quite frequently:

lib\importlib\_bootstrap.py:321: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.

I simply have no occurrence of importlib in my entire project. I'm assuming it's from a dependency my project have.

My question is: Where does this warning is coming from? How can I determine the source of warning?

As long as I keep my project with the latest Django's version, this might become a problem very soon.

MatheusJardimB
  • 3,599
  • 7
  • 46
  • 70
  • 1
    Both the answers to [this question](http://stackoverflow.com/questions/22373927/get-traceback-of-warnings) might help. Alternatively, you could install the Django 1.9 release candidate in your dev environment, and see what breaks! – Alasdair Nov 26 '15 at 17:50
  • Tx @Alasdair, but actually I'm quite interested to know where the warning is coming from. If it's originated from a deprecated lib, I'd better change the lib asap. You see my point? – MatheusJardimB Nov 26 '15 at 17:52
  • 2
    Yes, I understand that you want to know what code is causing the warning. If you install Django 1.9, then the code that uses `django.utils.importlib` will fail, and the traceback will tell you which library is using it. The answer that I linked to has a couple of other options, either by using the `-W` flag to turn warnings into errors, or monkeypatching the code so that the warnings show the traceback. – Alasdair Nov 26 '15 at 17:56
  • @Alasdair gotcha! It make sense. I'll try it out! – MatheusJardimB Nov 26 '15 at 17:57

1 Answers1

1

Use command grep.

grep -r "django.utils.importlib" /path/to/virtual_env
Anoop Malav
  • 1,397
  • 1
  • 10
  • 6