Hello Experts,
I am trying to Import a python module "xlrd" in FDMEE Custom Script. But always it throws error " No Module name xlrd".
I have tried importing the module by changing the sys path:
Below is the code that I have tried:
===========================================================================================
import sys
custModlePath = r'fdmContext["INBOXDIR"] + "\\Excel_Sample\\xlrd"'
sys.path.append(custModlePath)
import xlrd
path = fdmContext["INBOXDIR"] + "\\Excel_Sample\\"
pathout = fdmContext["INBOXDIR"] + "\\Excel_Sample\\Out"
book = xlrd.open_workbook(path)
data_sheet = book.sheet_by_name("Report")
#data_sheet = book.sheet_by_index(3)
start_row_count = 7
end_row_count = data_sheet.nrows
myfile = open(fdmContext["INBOXDIR"] + "\\Excel_Sample\\Out\\mapping.csv",'w')
#myfile = open('SG\OUT\mapping.txt','w')
while start_row_count < end_row_count:
#print data_sheet.row_values(i)
lines = data_sheet.row_values(start_row_count)
for line in data_sheet.row_values(start_row_count):
myfile.write(str(line))
myfile.write(",")
myfile.write("\n")
start_row_count = start_row_count+1
myfile.close()
=============================================================================================
ERROR:
2016-01-27 01:18:11,294 FATAL [AIF]: Error in CommProcess.executeCustomScript
Traceback (most recent call last):
File "<string>", line 191, in executeCustomScript
File "<string>", line 486, in executeCustomScript
File "<string>", line 528, in executeJythonScript
File "E:\FDMEE/data/scripts/custom/EXCEL_TO_CSV.py", line 6, in <module>
import xlrd
ImportError: No module named xlrd
2016-01-27 01:18:11,336 DEBUG [AIF]: The fdmAPI connection has been closed.
===========================================================================================
Appreciate your help!!
Thanks,
Ishti