我正在尝试 AlchemyAPI_Python-0.6 - PyXml 模块。我试图运行它的关键字提取器功能,但在尝试编译时出现以下错误。我使用了示例中给出的keywords.py 文件。我复制了 python 目录下的所有文件(AlchemyAPI.py、keywords.py、api_key.txt)。
Traceback (most recent call last):
File "C:\Python26\keywords.py", line 4, in <module>
import AlchemyAPI
File "C:\Python26\AlchemyAPI.py", line 6, in <module>
from xml import xpath
File "C:\Python26\lib\site-packages\_xmlplus\xpath\__init__.py", line 112, in <module>
from pyxpath import ExprParserFactory
File "C:\Python26\lib\site-packages\_xmlplus\xpath\pyxpath.py", line 59, in <module>
from xml.xpath.ParsedAbbreviatedRelativeLocationPath import ParsedAbbreviatedRelativeLocationPath
File "C:\Python26\lib\site-packages\_xmlplus\xpath\ParsedAbbreviatedRelativeLocationPath.py", line 31
as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
^
SyntaxError: invalid syntax
有人可以帮我解决这个问题吗?
先感谢您!