Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Closed
brettcannon opened this issue Feb 14, 2017 · 9 comments
Closed

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

brettcannon opened this issue Feb 14, 2017 · 9 comments

Comments

@brettcannon
Copy link
Member

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.

@gvanrossum
Copy link
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.

@gvanrossum
Copy link
Member

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

@ilevkivskyi
Copy link
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.

@brettcannon
Copy link
Member Author

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

@samuelcolvin
Copy link
Contributor

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.

@gvanrossum
Copy link
Member

gvanrossum commented Feb 17, 2017

@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.)

@samuelcolvin
Copy link
Contributor

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

@gvanrossum
Copy link
Member

gvanrossum commented Feb 17, 2017 via email

@emmatyping
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants