Error importing plugin "pydantic.mypy": cannot import name TypeVarDef

See original GitHub issue

Checks

  • I added a descriptive title to this issue
  • I have searched (google, github) for similar issues and couldn’t find anything
  • I have read and followed the docs and still think this is a bug

On the newest pydantic and newest mypy (0.920) I get:

mypy .                                                 
pyproject.toml:1: error: Error importing plugin "pydantic.mypy": cannot import name TypeVarDef
Found 1 error in 1 file (errors prevented further checking)

Bug

Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":

             pydantic version: 1.8.2
            pydantic compiled: True
                 install path: /Users/USERNAME/opt/anaconda3/envs/ENVNAME/lib/python3.9/site-packages/pydantic
               python version: 3.9.7 (default, Sep 16 2021, 08:50:36)  [Clang 10.0.0 ]
                     platform: macOS-10.16-x86_64-i386-64bit
     optional deps. installed: ['dotenv', 'typing-extensions']

Related issues in mypy issue tracker: https://github.com/python/mypy/issues/11767

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:27
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
karlankecommented, Mar 14, 2022

@samuelcolvin do you know when this might get released?

3reactions
gnmerrittcommented, Jun 7, 2022

For people who are wondering, version 1.9.1 is available on pip and includes this fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error importing plugin "pydantic.mypy": cannot import name ...
Error importing plugin "pydantic.mypy": cannot import name TypeVarDef # ... cannot import name TypeVarDef Found 1 error in 1 file (errors ...
Read more >
pipeline fails with 'cannot import name TypeVarDef' - geomar
python run-test: commands[0] | mypy demessaging setup.cfg:74: error: Error importing plugin "pydantic.mypy": cannot import name TypeVarDef ...
Read more >
tiangolo/fastapi - Gitter
setup.cfg:27: error: Error importing plugin 'pydantic.mypy': No module named 'pydantic' Found 1 error in 1 file (checked 5 source files).
Read more >
Mypy plugin - pydantic
With the pydantic mypy plugin, you can fearlessly refactor your models knowing mypy will catch any mistakes if your field names or types...
Read more >
How can mypy accept pydantic's constr() types? - Stack Overflow
I have this code: from pydantic import BaseModel, constr DeptNumber = constr(min_length ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found