2012-01-06 84 views
3

我试着运行Python/cminus的例子。 从http://pypi.python.org/pypi/stringtemplate3/3.1,我安装了python的stringtemplate3与sudo python setup.py install为python安装stringtemplate3

当我运行以此代码开头的cminus.py。

import sys 
import antlr3 
import stringtemplate3 

我得到了错误。

Traceback (most recent call last): 
    File "cminus.py", line 3, in <module> 
    import stringtemplate3 
    File "/Library/Python/2.7/site-packages/stringtemplate3/__init__.py", line 14, in <module> 
    from stringtemplate3.templates import * 
    File "/Library/Python/2.7/site-packages/stringtemplate3/templates.py", line 35, in <module> 
    import antlr 
ImportError: No module named antlr 

它看起来像stringtemplate3使用antlr不antlr3。

我该如何解决这个问题?

+0

安装鹿茸你不能只是修改stringtemplate3所以它使用antlr3? – Michael0x2a 2012-01-06 06:23:20

+0

我无法复制此内容。当我安装stringtemplate3并使用_that_特定版本时,我没有得到一个'ImportError:No module named antler'。 – 2012-01-06 08:50:44

回答