This may be side-stepping the question, but you could just try copying-and-
pasting the version of ElementTree from Python 2.7, renaming it to avoid
conflicting with the standard library, and importing and using that.
However, since ElementTree isn’t meant to be used as a standalone file, what
you need to do is navigate to
C:Python27Libxmland copy the entire
etreefolder and import ElementTree by doing
import etree.ElementTree
inside your script.
To avoid accidentally importing or using the version of ElementTree from
Python 2.6, you should probably rename the
etreefolder, its contents,
delete the
.pycfiles, and fix the imports inside the file to reference the
Python 2.7 version.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)