AttributeError: module 'html.parser' has no attribute 'HTMLParseError'

Eduardo_Lawson: <p>My code was working, untill I imported wandb and started to return error.<br>
I used pip to install wandb.<br>
Does someone had a error like that?<br>
Here is the error:</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "unimatch_v2.py", line 6, in &lt;module&gt;
    import wandb
  File "/home/pdi/.local/lib/python3.8/site-packages/wandb/__init__.py", line 27, in &lt;module&gt;
    from wandb import sdk as wandb_sdk
  File "/home/pdi/.local/lib/python3.8/site-packages/wandb/sdk/__init__.py", line 7, in &lt;module&gt;
    from .wandb_init import _attach, init  # noqa: F401
  File "/home/pdi/.local/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 31, in &lt;module&gt;
    from . import wandb_login, wandb_setup
  File "/home/pdi/.local/lib/python3.8/site-packages/wandb/sdk/wandb_login.py", line 25, in &lt;module&gt;
    from .wandb_settings import Settings, Source
  File "/home/pdi/.local/lib/python3.8/site-packages/wandb/sdk/wandb_settings.py", line 45, in &lt;module&gt;
    from wandb.sdk.internal.system.env_probe_helpers import is_aws_lambda
  File "/home/pdi/.local/lib/python3.8/site-packages/wandb/sdk/internal/system/env_probe_helpers.py", line 3, in &lt;module&gt;
    from sentry_sdk.integrations.aws_lambda import get_lambda_bootstrap  # type: ignore
  File "/home/pdi/.local/lib/python3.8/site-packages/sentry_sdk/integrations/aws_lambda.py", line 18, in &lt;module&gt;
    from sentry_sdk.integrations._wsgi_common import _filter_headers
  File "/home/pdi/.local/lib/python3.8/site-packages/sentry_sdk/integrations/_wsgi_common.py", line 13, in &lt;module&gt;
    from django.http.request import RawPostDataException
  File "/home/pdi/.local/lib/python3.8/site-packages/django/http/__init__.py", line 4, in &lt;module&gt;
    from django.http.response import (
  File "/home/pdi/.local/lib/python3.8/site-packages/django/http/response.py", line 13, in &lt;module&gt;
    from django.core.serializers.json import DjangoJSONEncoder
  File "/home/pdi/.local/lib/python3.8/site-packages/django/core/serializers/__init__.py", line 23, in &lt;module&gt;
    from django.core.serializers.base import SerializerDoesNotExist
  File "/home/pdi/.local/lib/python3.8/site-packages/django/core/serializers/base.py", line 6, in &lt;module&gt;
    from django.db import models
  File "/home/pdi/.local/lib/python3.8/site-packages/django/db/models/__init__.py", line 6, in &lt;module&gt;
    from django.db.models.query import Q, QuerySet, Prefetch  # NOQA
  File "/home/pdi/.local/lib/python3.8/site-packages/django/db/models/query.py", line 13, in &lt;module&gt;
    from django.db.models.fields import AutoField, Empty, FieldDoesNotExist
  File "/home/pdi/.local/lib/python3.8/site-packages/django/db/models/fields/__init__.py", line 18, in &lt;module&gt;
    from django import forms
  File "/home/pdi/.local/lib/python3.8/site-packages/django/forms/__init__.py", line 6, in &lt;module&gt;
    from django.forms.fields import *  # NOQA
  File "/home/pdi/.local/lib/python3.8/site-packages/django/forms/fields.py", line 18, in &lt;module&gt;
    from django.forms.utils import from_current_timezone, to_current_timezone
  File "/home/pdi/.local/lib/python3.8/site-packages/django/forms/utils.py", line 15, in &lt;module&gt;
    from django.utils.html import format_html, format_html_join, escape
  File "/home/pdi/.local/lib/python3.8/site-packages/django/utils/html.py", line 16, in &lt;module&gt;
    from .html_parser import HTMLParser, HTMLParseError
  File "/home/pdi/.local/lib/python3.8/site-packages/django/utils/html_parser.py", line 12, in &lt;module&gt;
    HTMLParseError = _html_parser.HTMLParseError
AttributeError: module 'html.parser' has no attribute 'HTMLParseError'
</code></pre>
<p>Thanks in advance</p>

ptrblck: <aside class="quote no-group" data-username="Eduardo_Lawson" data-post="1" data-topic="212573">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/eduardo_lawson/48/66899_2.png" class="avatar"> Eduardo_Lawson:</div>
<blockquote>
<pre><code class="lang-auto">  File "/home/pdi/.local/lib/python3.8/site-packages/django/utils/html_parser.py", line 12, in &lt;module&gt;
    HTMLParseError = _html_parser.HTMLParseError
AttributeError: module 'html.parser' has no attribute 'HTMLParseError'
</code></pre>
</blockquote>
</aside>
<p>The issue seems to be caused by <code>django</code> so check if <code>wandb</code> updated or downgraded the package.</p>