module 'html.parser' has no attribute 'HTMLParseError'
来源:互联网 发布:医疗网络营销策划 编辑:程序博客网 时间:2024/05/29 18:42
错误描述
- python==3.5
- django==1.7
django创建项目时报错如下:
Traceback (most recent call last): File "/root/envs/django-test/bin/django-admin", line 11, in <module> sys.exit(execute_from_command_line()) File "/root/envs/django-test/lib/python3.5/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() File "/root/envs/django-test/lib/python3.5/site-packages/django/core/management/__init__.py", line 354, in execute django.setup() File "/root/envs/django-test/lib/python3.5/site-packages/django/__init__.py", line 18, in setup from django.utils.log import configure_logging File "/root/envs/django-test/lib/python3.5/site-packages/django/utils/log.py", line 10, in <module> from django.views.debug import ExceptionReporter, get_exception_reporter_filter File "/root/envs/django-test/lib/python3.5/site-packages/django/views/debug.py", line 10, in <module> from django.http import (HttpResponse, HttpResponseServerError, File "/root/envs/django-test/lib/python3.5/site-packages/django/http/__init__.py", line 4, in <module> from django.http.response import (HttpResponse, StreamingHttpResponse, File "/root/envs/django-test/lib/python3.5/site-packages/django/http/response.py", line 13, in <module> from django.core.serializers.json import DjangoJSONEncoder File "/root/envs/django-test/lib/python3.5/site-packages/django/core/serializers/__init__.py", line 23, in <module> from django.core.serializers.base import SerializerDoesNotExist File "/root/envs/django-test/lib/python3.5/site-packages/django/core/serializers/base.py", line 6, in <module> from django.db import models File "/root/envs/django-test/lib/python3.5/site-packages/django/db/models/__init__.py", line 6, in <module> from django.db.models.query import Q, QuerySet, Prefetch # NOQA File "/root/envs/django-test/lib/python3.5/site-packages/django/db/models/query.py", line 13, in <module> from django.db.models.fields import AutoField, Empty File "/root/envs/django-test/lib/python3.5/site-packages/django/db/models/fields/__init__.py", line 18, in <module> from django import forms File "/root/envs/django-test/lib/python3.5/site-packages/django/forms/__init__.py", line 6, in <module> from django.forms.fields import * # NOQA File "/root/envs/django-test/lib/python3.5/site-packages/django/forms/fields.py", line 18, in <module> from django.forms.utils import from_current_timezone, to_current_timezone File "/root/envs/django-test/lib/python3.5/site-packages/django/forms/utils.py", line 15, in <module> from django.utils.html import format_html, format_html_join, escape File "/root/envs/django-test/lib/python3.5/site-packages/django/utils/html.py", line 16, in <module> from .html_parser import HTMLParser, HTMLParseError File "/root/envs/django-test/lib/python3.5/site-packages/django/utils/html_parser.py", line 12, in <module> HTMLParseError = _html_parser.HTMLParseErrorAttributeError: module 'html.parser' has no attribute 'HTMLParseError'(django-test) root@localhost:~/source/djangotest# django-admin startproject superlistsTraceback (most recent call last): File "/root/envs/django-test/bin/django-admin", line 11, in <module> sys.exit(execute_from_command_line()) File "/root/envs/django-test/lib/python3.5/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() File "/root/envs/django-test/lib/python3.5/site-packages/django/core/management/__init__.py", line 354, in execute django.setup() File "/root/envs/django-test/lib/python3.5/site-packages/django/__init__.py", line 18, in setup from django.utils.log import configure_logging File "/root/envs/django-test/lib/python3.5/site-packages/django/utils/log.py", line 10, in <module> from django.views.debug import ExceptionReporter, get_exception_reporter_filter File "/root/envs/django-test/lib/python3.5/site-packages/django/views/debug.py", line 10, in <module> from django.http import (HttpResponse, HttpResponseServerError, File "/root/envs/django-test/lib/python3.5/site-packages/django/http/__init__.py", line 4, in <module> from django.http.response import (HttpResponse, StreamingHttpResponse, File "/root/envs/django-test/lib/python3.5/site-packages/django/http/response.py", line 13, in <module> from django.core.serializers.json import DjangoJSONEncoder File "/root/envs/django-test/lib/python3.5/site-packages/django/core/serializers/__init__.py", line 23, in <module> from django.core.serializers.base import SerializerDoesNotExist File "/root/envs/django-test/lib/python3.5/site-packages/django/core/serializers/base.py", line 6, in <module> from django.db import models File "/root/envs/django-test/lib/python3.5/site-packages/django/db/models/__init__.py", line 6, in <module> from django.db.models.query import Q, QuerySet, Prefetch # NOQA File "/root/envs/django-test/lib/python3.5/site-packages/django/db/models/query.py", line 13, in <module> from django.db.models.fields import AutoField, Empty File "/root/envs/django-test/lib/python3.5/site-packages/django/db/models/fields/__init__.py", line 18, in <module> from django import forms File "/root/envs/django-test/lib/python3.5/site-packages/django/forms/__init__.py", line 6, in <module> from django.forms.fields import * # NOQA File "/root/envs/django-test/lib/python3.5/site-packages/django/forms/fields.py", line 18, in <module> from django.forms.utils import from_current_timezone, to_current_timezone File "/root/envs/django-test/lib/python3.5/site-packages/django/forms/utils.py", line 15, in <module> from django.utils.html import format_html, format_html_join, escape File "/root/envs/django-test/lib/python3.5/site-packages/django/utils/html.py", line 16, in <module> from .html_parser import HTMLParser, HTMLParseError File "/root/envs/django-test/lib/python3.5/site-packages/django/utils/html_parser.py", line 12, in <module> HTMLParseError = _html_parser.HTMLParseErrorAttributeError: module 'html.parser' has no attribute 'HTMLParseError'
原因
HTMLParseError在pythons3.5已经没有了
解决方法
- 将python版本回退到3.3或3.4
- 升级django版本
阅读全文
0 0
- module 'html.parser' has no attribute 'HTMLParseError'
- 新建django程序时报错AttributeError: module 'html.parser' has no attribute 'HTMLParseError'
- AttributeError: 'module' object has no attribute 'getpass'
- 'module' object has no attribute 'basicConfig'
- AttributeError: 'module' object has no attribute 'Serial'
- 'module' object has no attribute 'rindex'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- Django: 'module' object has no attribute 'index'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- python-module 'pymysql' has no attribute 'connect'
- AttributeError: 'module' object has no attribute 'XXX'
- AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError:'module' object has no attribute 'classify'
- AttributeError: ‘module’ object has no attribute’xxx’
- AttributeError: ‘module’ object has no attribute’ 问题
- Android自定义View学习之画太极图
- Google官方Android O和kotlin Demo
- 通俗理解卡尔曼滤波及其算法实现(实例解析)
- mybatis的常用操作
- hdu2457 poj3691 DNA Repair AC自动机 + dp
- module 'html.parser' has no attribute 'HTMLParseError'
- Android 修改应用中的字体
- Oracle MyBatis批量插入
- 产品经理到底是要做全职保姆式_还是要做合作伙伴式?
- Android Kotlin的使用和第一个项目HelloKotlin
- Scala_(5)_隐式转换|并发编程
- String、StringBuffer、StringBuilder的区别与效率比较
- android适配器中view复用的示例代码
- Bower+grunt-wiredep自动注入包到html