Python+ANTLR4: No module named antlr4

╄→гoц情女王★ 提交于 2019-12-06 08:53:24

You need to install antlr4 for python through pip:

sudo pip install antlr4-python2-runtime

If you don't have pip on you system, install it first with:

sudo pacman -S python2-pip

The problem was that antlr4 was only installed for Python3 and not Python2. I simply copied the antlr4 files from /usr/lib/python3.6/site-packages/ to /usr/lib/python2.7/site-packages/ and this solved the problem!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!