Menu

#1379 Undefined variable from import

open
nobody
None
5
2011-09-01
2011-09-01
Anonymous
No

Using Python 2.6.6, Eclipse 3.6 and PyDev 2.2.2
The following gives "Undefined variable from import: parse" error on the third line:

from lxml import etree
with open('somefile.xml','r') as f:
tree = etree.parse(f)

Discussion