1

I have a script that imports ESRI's MDCS (Mosaic Dataset Configuration Script). When I run it as a published web tool on the server, I get the error ModuleNotFoundError: No module named 'logger'

Is this to be expected as the module is indeed not included in the standard packages of ArcGIS Server (does not seem to be inlcuded in ArcGIS Pro Python Packages)? So now I just need to ask my organization's administrator to add that module to the server as in https://enterprise.arcgis.com/de/server/latest/publish-services/windows/deploying-custom-python-packages.htm ? Or is there maybe some other mistake?

1
  • 1
    The logger module is included with MDCS, but it's in a subdirectory that is added to the python module search path at runtime using sys.path.append. Apparently this doesn't work for web tools. Suggest you raise an issue. You could also try importing it in your script to make sure it gets picked up by the web tool publishing process.
    – user2856
    May 16, 2023 at 23:05

1 Answer 1

1

As @user2856 has pointed out, I solved it by importing the module in my script. I forgot that logger.py was just one of the local scripts in a subdirectory. However, I copied the logger.py file not only to the directory where my script is, but also to the script directory where mdcs.py is saved, so I cannot say for sure if maybe that second measure solved it.

I did the same with SolutionsLib and Base.

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.