You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/02/15 02:11:23 UTC

[GitHub] [incubator-tvm] masahi opened a new pull request #4888: improve antlr import error message

masahi opened a new pull request #4888: improve antlr import error message
URL: https://github.com/apache/incubator-tvm/pull/4888
 
 
   Currently, the error message I get from the parser import failure is confusing.
   
   If I try to use VM functionality, I get an error `Couldn't find ANTLR parser. Try building with USE_ANTLR=ON.` But even if I rebuild TVM with USE_ANTLR=ON, I still get the same error because the generated parser try to import the antlr4 python package that I haven't installed, but the error still says `Try building with USE_ANTLR=ON`. 
   
   This is confusing, I think 
   ```Python
   try:
       from antlr4 import InputStream, CommonTokenStream
       from antlr4.error.ErrorListener import ErrorListener
   except ImportError:
       raise Exception("Couldn't find ANTLR runtime." +
                       "Try running `pip{version} install antlr4-python{version}-runtime`."
                       .format(version=PYTHON_VERSION))
   ```
   
   should come before
   
   ```Python
   try:
       from .grammar.py3.RelayVisitor import RelayVisitor
       from .grammar.py3.RelayParser import RelayParser
       from .grammar.py3.RelayLexer import RelayLexer
   except ImportError:
       raise Exception("Couldn't find ANTLR parser. Try building with USE_ANTLR=ON.")
   ```
   because the latter depends on the antlr4 python package.
   
   please review @wweic @zhiics @icemelon9 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] icemelon9 merged pull request #4888: improve antlr import error message

Posted by GitBox <gi...@apache.org>.
icemelon9 merged pull request #4888: improve antlr import error message
URL: https://github.com/apache/incubator-tvm/pull/4888
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] icemelon9 commented on issue #4888: improve antlr import error message

Posted by GitBox <gi...@apache.org>.
icemelon9 commented on issue #4888: improve antlr import error message
URL: https://github.com/apache/incubator-tvm/pull/4888#issuecomment-586628690
 
 
   Thanks @masahi 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services