Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named base in html5lib

I suddenly can't start may Django server any more, running check:

python manage.py check

shows to the following error:

    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

Have you any idea?

like image 847
Aymen Gasmi Avatar asked Mar 10 '17 10:03

Aymen Gasmi


1 Answers

I think your html5lib is not compatibale with the bleach version. Maybe for some reason you have the latest version of bleach but not the lastest of html5lib. The version bleach 2.0.0 no longer supports html5lib < 0.99999999 (8 9s). Check Backwards incompatible changes

I think you have to install the latest html5lib (9 9s).

pip install html5lib==0.999999999
like image 153
Dhia Avatar answered Oct 17 '22 21:10

Dhia