Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

479
Vistas
Python Django ImportError: cannot import name 'Required' from 'typing_extensions'

Django version is 3.2.9.

Python version is 3.10.0.

And typing_extensions 3.10.0.2

I'm new to coding, python, etc., and can't figure out what is the problem. Following django tutorial I created an app and ran the server successfully, but a day later, when I tried to do that again I faced this problem:

File "C:\Users\fused\Desktop\code\py\myproject\myapp\views.py", line 1, in <module>
from typing_extensions import Required
ImportError: cannot import name 'Required' from 'typing_extensions' (C:\Users\fused\AppData\Local\Programs\Python\Python310\lib\site-packages\typing_extensions.py)

After trying to run a server with 'python manage.py runserver' this problem appeared, tried reinstalling typing_extensions, checked versions of everything, but nothing solved the problem.

If any additional information is needed, I'll reply with it. Thanks in advance

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Update

Support for Required and NotRequired have been added to typing_extensions version 4.0.0 as experimental features.

Everything should work for now like it's stated in PEP 655.

Old Answer

It seems like Required and NotRequired aren't implemented yet in typing_extensions.

PEP 655 states:

The goal is to be able to make the following statement:

The mypy type checker supports Required and NotRequired. A reference implementation of the runtime component is provided in the typing_extensions module.

It's just the goal — it isn't the current state. It is neither listed in typing_extensions' README nor does it appear in the source code.

I think it is really confusing that vscode's pylance/pyright can resolve typing_extensions.Required and typing_extensions.NotRequired, even though it isn't implemented in the module.

As a workaround you could try to replace from typing_extensions import Required with

try:
    from typing_extensions import Required
except ImportError:
    from typing import Generic, TypeVar

    T = TypeVar("T")

    class Required(Generic[T]):
        pass
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda