Python recipe Excel packages
![User](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar21.png)
Hello everyone,
I have an issue while constructing excel with python recipe.
I need to use precise packages (xlsxwriter, xlwings, openpyxl and so on) that work very well in Anaconda.But in Dataiku python recipe it's not the case.
In my mind with python recipe I could do whatever python usually does.
Ex below of a line that does not work:
XlwingsError: Your platform only supports the instantiation via xw.Book(json=...)
Does anyone have a solution please ?
Thank you!
Best regards
Answers
-
Sergey Dataiker, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts Posts: 365 Dataiker
Hi @User
You can indeed do anything you want in python recipes as far as python itself supports this. Here the question is that xlwings natively supports only Windows and Mac OS:
https://docs.xlwings.org/en/stable/installation.html#id2
@property def impl(self): if engines.active is None: if not ( sys.platform.startswith("darwin") or sys.platform.startswith("win") ): raise XlwingsError( "Your platform only supports the " "instantiation via xw.Book(json=...)" ) elif sys.platform.startswith("darwin"): raise XlwingsError( 'Make sure to have "appscript" and "psutil", ' "dependencies of xlwings, installed." ) elif sys.platform.startswith("win"): raise XlwingsError( 'Make sure to have "pywin32", a dependency of xlwings, installed.' ) return engines.active.apps.impl
That's why the error related to the platform (OS).
-
Hello @sergeyd
,Thank you for the answer !
So actually DataIku runs on a Linux system ? I supposed it was windows but from your message I understand it is not the case.. Any way to fix it ? I've many python code I wanted to apply in recipes but I cannot.
Thank you
-
Sergey Dataiker, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts Posts: 365 Dataiker
Hi @User
Yes, DSS is Unix-based:
https://doc.dataiku.com/dss/latest/installation/custom/requirements.html
You will need to search online for alternatives. Something like this:
https://stackoverflow.com/questions/68771270/xlwings-alternative-on-linux
-
hello @User ,
please have you find the solution for this problem ? beacuase I have the same issue.
Thank you