[Django]-ModuleNotFoundError: No module named 'typing_extensions'

34👍

There must be an import from typing-extensions module in blog\views.py file on line 1

in your code.
Use this command to install it

pip install typing-extensions

after that this issue will be resolved.

4👍

I had the same error.

Mine came from models.py

models.py

from typing_extensions import Required
from django.db import models


class nameOfModel(models.Model):
    nameOfField = models.CharField(max_length=255, Required=True)

Because I used Required=True, VSCode added automatically from typing_extensions import Required.

So I did this instead.

models.py

from django.db import models


class nameOfModel(models.Model):
    nameOfField = models.CharField(max_length=255, blank=False)

1👍

This is a problem with the forms.Textarea wich cannot accept required, so it calls for import from typing-extensions and this make the problem

Leave a comment