Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
adam-pawluczuk opened this issue Dec 16, 2021 · 6 comments · Fixed by #3175
Closed
3 tasks done

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

adam-pawluczuk opened this issue Dec 16, 2021 · 6 comments · Fixed by #3175
Labels
bug V1 Bug related to Pydantic V1.X

Comments

@adam-pawluczuk
Copy link

adam-pawluczuk commented Dec 16, 2021

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:
python/mypy#11767

@hauntsaninja
Copy link
Contributor

hauntsaninja commented Dec 16, 2021

Linking this PR: #3175 (comment)

stishkin pushed a commit to stishkin/onefuzz that referenced this issue Dec 16, 2021
stishkin added a commit to microsoft/onefuzz that referenced this issue Dec 16, 2021
pydantic/pydantic#3528

python/mypy#6617 (comment)
pydantic/pydantic#3175 (comment)

updating mypy in build yml and requirements to 0.910

Co-authored-by: stas <statis@microsoft.com>
manthey added a commit to SCIInstitute/shapeworks-cloud that referenced this issue Dec 20, 2021
Until then pydantic will always fail.  See
pydantic/pydantic#3528.
@manthey
Copy link

manthey commented Dec 20, 2021

I don't know -- we need to ask a pydantic maintainer when they will issue a release.

@karlanke
Copy link

@samuelcolvin do you know when this might get released?

@jeeftor
Copy link

jeeftor commented Mar 17, 2022

Is there a way to point to this pre-release version in pip?

@jeeftor
Copy link

jeeftor commented Mar 17, 2022

Is there a way to pull this version into pip?

@gnmerritt
Copy link

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

MichaelMatschiner pushed a commit to MichaelMatschiner/onefuzz that referenced this issue Dec 26, 2022
pydantic/pydantic#3528

python/mypy#6617 (comment)
pydantic/pydantic#3175 (comment)

updating mypy in build yml and requirements to 0.910

Co-authored-by: stas <statis@microsoft.com>
agoscinski added a commit to agoscinski/aiida-restapi that referenced this issue May 21, 2024
Updating pydantic version in pre-commit config to 1.10 to fix import
error and to be consistent with the version in the pyproject.toml.
See issue pydantic/pydantic#3528
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants