ImportError:html5lib中没有名为base的模块

时间:2017-03-10 10:14:31

标签: python django importerror requirements.txt html5lib

我突然无法启动Django服务器了,运行检查:

python manage.py check

显示以下错误:

    apps.populate(settings.INSTALLED_APPS)
  File "/home/aym/.virtualenvs/prod_env/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/home/aym/.virtualenvs/prod_env/local/lib/python2.7/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/aym/workspace/CompanyP/apps/account/models.py", line 18, in <module>
    from apps.groups.models import SubscriptionGroup
  File "/home/aym/workspace/CompanyP/apps/subscription/models.py", line 8, in <module>
    from apps.member.models import Member
  File "/home/aym/.virtualenvs/prod_env/local/lib/python2.7/site-packages/bleach/__init__.py", line 5, in <module>
    from bleach.linkifier import 
  File "/home/aym/.virtualenvs/prod_env/local/lib/python2.7/site-packages/bleach/linkifier.py", line 5, in <module>
    from html5lib.filters.base import Filter
ImportError: No module named base

你有什么想法吗?

1 个答案:

答案 0 :(得分:5)

我认为您的html5libbleach版本不兼容。也许出于某种原因,你有bleach的最新版本,但不是最新版本的html5lib。版本漂白2.0.0不再支持html5lib&lt; 0.99999999(8 9s)。查看Backwards incompatible changes

我认为你必须安装最新的html5lib(9 9s)。

pip install html5lib==0.999999999