Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

470
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!