ImportError on ArcGIS Server: No module named xlsxwriter

873
2
06-03-2019 01:35 AM
GianniContino
New Contributor III
Hi All,
I'm trying to publish on ArcGIS Server a geoprocessing service, which creates an Excel File with some data.
I'm using Pandas and XlsxWriter but locally it works. On the ArcGIS Server (linux machine) it does not.
Seems like it can't find module, though I have installed and overwritten it in different ways, and in python console it imports module with no errors.
On ArcGIS Server manager page script fails and logs:
ImportError: No module named xlsxwriter Failed to execute (Script).
any workaround?
thanx
2 Replies
JoshuaBixby
MVP Esteemed Contributor
in python console it imports module with no errors.

Is that the Python console on your local machine or server?  If server, what path are you using to run the Python console?  What version of ArcGIS Server and what version of Linux?

0 Kudos
ChristophFederle
New Contributor

Maybe it'll help:
we also needed a additional custom Python package. As we only have access to our Linux server via shell, we installed the missing module via  "/<ArcGISServer_InstallDir>/server/tools/python -m pip install <modulname>". The package was insalled into /<ArcGISServer_InstallDir>/server/framework/runtime/.wine/drive_c/Python27/ArcGISx6410.6/Lib/site-packages

Update: we finally copied the folder of the site package into: /<ArcGISServer_InstallDir>/server/framework/runtime/ArcGIS/bin/Python/envs/arcgispro-py3/Lib/site-packages. I don't know if this is the correct way to do, but now our geoprocessing service can use the custom Python package.