A python script which parses xml file runs independently fine but when it is called via views.py in flask it throws error. Even trying to parse xml file from views.py itself it throws error. Following are a couple of lines of code which throws error:
from lxml import etree
doc1=etree.parse('file.xml')
Error:
IOError: Error reading file 'file.xml': failed to load external entity "file.xml"