Cannot import importlib

后端 未结 2 1506
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 08:40

I am trying to use Listfield from djangotoolbox.fields but it is giving me an error saying :

Traceback (most recent call last):
File \"/Library/Python/2.7/site-p         


        
相关标签:
2条回答
  • 2021-01-27 09:18

    use from importlib import import_module

    0 讨论(0)
  • 2021-01-27 09:19

    django.utils.importlib is a compatibility library for when Python 2.6 was still supported. It has been obsolete since Django 1.7, which dropped support for Python 2.6, and is removed in 1.9 per the deprecation cycle.

    Try this

    from importlib import import_module
    

    source here.

    0 讨论(0)
提交回复
热议问题