如何修复python3中的“ etree.tostring(root)”无效语法错误

时间:2019-06-07 16:06:34

标签: python python-3.x

我正在尝试在python3中使用lxml解析xml文件,并从lxml import etree获取“ ImportError:DLL加载失败:找不到指定的模块。“错误

#!/usr/bin/env python3
from lxml import etree    
from io import StringIO, BytesIO  
xml ="<a xmlns="test"><b xmlns="test"/></a>"   
root = etree.parse(xml)  
print (etree.tostring(root))  



C:\Users\test\test1>new1.py
Traceback (most recent call last):
File "C:\Users\test\test1\new1.py", line 3, in modulee>
from lxml import etree
ImportError: DLL load failed: The specified module could not be found.

0 个答案:

没有答案