You can easily install Python packages with Origin2020b, just run InstallPythonPackages from the Script Window, for example to run the follow Excel export code, need to install xlsxwriter, then just open Script Window and type
InstallPythonPackages(0,xlsxwriter)
and hit enter.
To try this code, open Code Builder, new a py file in UFF, like call it test1.py, then paste the code below, save the file, and from Script Window type "run -pyf test1.py". This code assume you have a worksheet to export with some data:
import PyOrigin
import xlsxwriter
wks = PyOrigin.ActiveLayer()
file = PyOrigin.GetPath(PyOrigin.PATHTYPE_USER)+'Data.xlsx'
workbook = xlsxwriter.Workbook(file)
worksheet = workbook.add_worksheet()
bold = workbook.add_format({'bold': 1})
for i, col in enumerate(wks):
header = col.GetLongName();
unit = col.GetUnits();
data = col.GetData()
worksheet.write(0, i, header, bold)
worksheet.write(1, i, unit, bold)
worksheet.write_column(2, i, data)
workbook.close()
There is also an App for installing packages, see
https://www.originlab.com/fileExchange/details.aspx?fid=414
Please note that if you had error with Python before you install a package, you need to restart Origin.
CP