I have a Python geoprocessing tool, it is split in several Python files, When I use ArcGIS Pro to publish it as a service into the ArcGIS Server, all the dependencies are packed and deployed to the service.

Now the tool is internationalized and localized using gettext and have the following structure:


The Python files are deployed but neither *.mo nor *.po files are deployed.

How can I make that those files are included in the set of files deployed to the ArcGIS Server?

[UPDATE] If In the file Alignment.py I make a horrible hack like this i:

locale_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "locale/Spanish/LC_MESSAGES/")

the folder and its content are added to the service, but the folder structure changes a lot:

     |   |-Alignment.py

1 Answer 1


Take a look at the Authoring Geoprocessing Services with Python help, specifically the section on Importing other modules. This is essentially the same scenario you're working on.

You've got everything in a folder(s). You'll want to make a variable in your script that points to these folders. I'd suggest writing the full path to the folder in your script (c:/locale/spanish/...), not the relative path. During the publishing process, as long as the variable (folder its pointing at) is NOT referenced in the data store, the folder and it's contents will be copied. The hard path you have in your script (c:/locale/spanish/..) will be updated to the hardpath on the server where the folder is copied too.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.