Skip to content

mypy 0.471 not finding typed-ast 1.0.0 when using --fast-parser #2862

Closed

Description

@brettcannon

python3 -c "from typed_ast import ast27, ast3" doesn't raise an ImportError and yet running mypy keeps telling me:

You must install the typed_ast package before you can run mypy with `--fast-parser`.
You can do this with `python3 -m pip install typed-ast`.

It looks like mypy 0.471 imports typed_ast.ast35 which doesn't exist in typed_ast 1.0.0.

Activity

  1. gvanrossum commented on Feb 14, 2017

    @gvanrossum
    Member

    I had this problem too, reinstalling (pip3 install -U) didn't help. But it went away after I manually removed site-packages/mypy/ and then reinstalled again.

  2. gvanrossum commented on Feb 14, 2017

    @gvanrossum
    Member

    Hm, I wonder if some metadata lingers around when you use pip uninstall and doesn't get overwritten when you reinstall?

  3. ilevkivskyi commented on Feb 14, 2017

    @ilevkivskyi
    Member

    Hm, I wonder if some metadata lingers around when you use pip uninstall and doesn't get overwritten when you reinstall?

    It looks like this happened to me, typeshed was not overwritten, until I completely removed it manually.

  4. brettcannon commented on Feb 14, 2017

    @brettcannon
    MemberAuthor

    Apparently explicitly installing typed-ast first solved the issue as well: python/the-knights-who-say-ni#93.

  5. samuelcolvin commented on Feb 17, 2017

    @samuelcolvin
    SponsorContributor

    This seems to still be a problem, even with release of typed-ast-1.0.1, see this travis build for example.

    Locally I've tried completely deleting my virtualenv directory and recreating but to no avail.

  6. gvanrossum commented on Feb 17, 2017

    @gvanrossum
    Member

    @samuelcolvin You're still using mypy 0.4.6. You gotta update your test/requirements.txt to use mypy==0.471 instead of mypy-lang=0.4.6. (Note the different spelling of both the package name and the version.)

  7. samuelcolvin commented on Feb 17, 2017

    @samuelcolvin
    SponsorContributor

    Thanks, I also had to remove the typed-ast requirement to allow mypy to install the version of typed-ast it wants.

    As per this mypy 4.7 requires typed-ast >= 0.6.3, < 0.7.0 and (for me at least) alwasy fails with 1 or 1.0.1

  8. gvanrossum commented on Feb 17, 2017

    @gvanrossum
    Member
  9. emmatyping commented on Sep 6, 2017

    @emmatyping
    Member

    I believe this can be closed. If someone encounters an issue with a newer release, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions