Closed dclong closed 3 years ago
That looks very suspiciously like it's caused by our switch from pure Python to a C++ extension for the typegraph code. Are you able to install pytype 2020.10.08 (the version before we made the switch)?
As a side note, pytype doesn't officially support Windows, but I'm happy to do my best to help with troubleshooting.
I'm going to close this issue, since I don't have enough information to follow up on it. Let me know if you're still having trouble with installing pytype!
Same problem - @rchen152 your suggestion (installing version 2020.10.08) resolved the issue, thanks.
Had the same issue on Windows.
Version 2020.10.08 does not seem to be on pip anymore. However, pip install pytype==2020.2.6
worked for me.
That looks very suspiciously like it's caused by our switch from pure Python to a C++ extension for the typegraph code
Would be nice if this could be fixed in newer versions. Should one create an issue on the typegraph project so they can tackle the issue?
typegraph is not a separate project, it's a component of pytype that was rewritten as a C++ extension for performance reasons. it looks like some of the code does not compile under MSVC; since pytype is developed on linux we are unable to track down and fix the incompatibilities ourselves, but we would welcome a pull request to fix it.
updated error message: (important part only)
pytype/typegraph/cfg.cc(195): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
pytype/typegraph/cfg.cc(368): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
pytype/typegraph/cfg.cc(513): error C2065: 'tp_name': undeclared identifier
pytype/typegraph/cfg.cc(513): error C2059: syntax error: ':'
pytype/typegraph/cfg.cc(558): error C2143: syntax error: missing ';' before '}'
pytype/typegraph/cfg.cc(558): error C2059: syntax error: '}'
pytype/typegraph/cfg.cc(597): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data
pytype/typegraph/cfg.cc(727): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
pytype/typegraph/cfg.cc(754): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
pytype/typegraph/cfg.cc(786): error C2065: 'tp_name': undeclared identifier
pytype/typegraph/cfg.cc(786): error C2059: syntax error: ':'
pytype/typegraph/cfg.cc(821): error C2143: syntax error: missing ';' before '}'
pytype/typegraph/cfg.cc(821): error C2059: syntax error: '}'
pytype/typegraph/cfg.cc(841): error C2065: 'name': undeclared identifier
pytype/typegraph/cfg.cc(841): error C2059: syntax error: ':'
pytype/typegraph/cfg.cc(845): error C2143: syntax error: missing ';' before '}'
pytype/typegraph/cfg.cc(845): error C2059: syntax error: '}'
pytype/typegraph/cfg.cc(1016): error C2065: 'tp_name': undeclared identifier
pytype/typegraph/cfg.cc(1016): error C2059: syntax error: ':'
pytype/typegraph/cfg.cc(1051): error C2143: syntax error: missing ';' before '}'
pytype/typegraph/cfg.cc(1051): error C2059: syntax error: '}'
pytype/typegraph/cfg.cc(1090): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data
pytype/typegraph/cfg.cc(1415): error C2065: 'tp_name': undeclared identifier
pytype/typegraph/cfg.cc(1415): error C2059: syntax error: ':'
pytype/typegraph/cfg.cc(1450): error C2143: syntax error: missing ';' before '}'
pytype/typegraph/cfg.cc(1450): error C2059: syntax error: '}'
updated error message: (important part only)
pytype/typegraph/cfg.cc(195): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data pytype/typegraph/cfg.cc(368): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data pytype/typegraph/cfg.cc(513): error C2065: 'tp_name': undeclared identifier pytype/typegraph/cfg.cc(513): error C2059: syntax error: ':' pytype/typegraph/cfg.cc(558): error C2143: syntax error: missing ';' before '}' pytype/typegraph/cfg.cc(558): error C2059: syntax error: '}' pytype/typegraph/cfg.cc(597): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data pytype/typegraph/cfg.cc(727): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data pytype/typegraph/cfg.cc(754): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data pytype/typegraph/cfg.cc(786): error C2065: 'tp_name': undeclared identifier pytype/typegraph/cfg.cc(786): error C2059: syntax error: ':' pytype/typegraph/cfg.cc(821): error C2143: syntax error: missing ';' before '}' pytype/typegraph/cfg.cc(821): error C2059: syntax error: '}' pytype/typegraph/cfg.cc(841): error C2065: 'name': undeclared identifier pytype/typegraph/cfg.cc(841): error C2059: syntax error: ':' pytype/typegraph/cfg.cc(845): error C2143: syntax error: missing ';' before '}' pytype/typegraph/cfg.cc(845): error C2059: syntax error: '}' pytype/typegraph/cfg.cc(1016): error C2065: 'tp_name': undeclared identifier pytype/typegraph/cfg.cc(1016): error C2059: syntax error: ':' pytype/typegraph/cfg.cc(1051): error C2143: syntax error: missing ';' before '}' pytype/typegraph/cfg.cc(1051): error C2059: syntax error: '}' pytype/typegraph/cfg.cc(1090): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data pytype/typegraph/cfg.cc(1415): error C2065: 'tp_name': undeclared identifier pytype/typegraph/cfg.cc(1415): error C2059: syntax error: ':' pytype/typegraph/cfg.cc(1450): error C2143: syntax error: missing ';' before '}' pytype/typegraph/cfg.cc(1450): error C2059: syntax error: '}'
exactly the same issue happens on me now
Hi, I'm trying to look into this MSVC syntax error, but for the life of me I can't figure out how to use /std:c++20
instead of /std:c++14
when doing pip install . -e
so I can try some things. (namely using standard designated initializers)
I'm testing a Python package on Windows using GitHub Actions.
pytype
is a dependency. However, it failed to install. Below is the error message.