I try to execute the following code on an ArcGIS Server for Linux installation (Version 10.5, BuildNumber 8707):
import arcpy
arcpy.mp.ArcGISProject('blank.aprx')
and get the following Error:
File "/opt/anaconda/envs/arcgis/lib/python3.5/site-packages/arcpy/_mp.py", line 283, in __init__
self._arc_object = arcgisscripting._mapping.ArcGISProject(*gp_fixargs((aprx_path,), True))
AttributeError: module 'arcgisscripting' has no attribute '_mapping'
the same code works fine on Windows with an ArcGIS Pro 2.0 Installation (Build Number 8933).
Is there same API-Change I am not aware of? Did I mess up during the setup? How can I investigate this issue further?
Pro uses Python 3.x, ArcGIS Server still uses 2.x (2.7 I believe). The .mp module is new to Pro
And although you didn't specifically mention publishing to Server from Pro, that is not supported. Check this thread out
How to publish a service from ArcGIS Pro to ArcGIS server?
also tagging ArcGIS Enterprise for more exposure.
According to the documentation (The Python 3 runtime for ArcGIS Server on Linux—ArcGIS Server Administration (Linux) | ArcGIS Enterp... ) the runtime for 10.5 moved to python 3.5 ..
In my code I call the new arcpy.mp API, the _mapping part which is not found is called in the background
Pro using arcpy.mp http://pro.arcgis.com/en/pro-app/arcpy/mapping/introduction-to-arcpy-mp.htm and python 3.5, ArcMap uses arcpy.mapping and python 2.7, but the version of python shouldn't be an issue (I think).
arcpy.mp is accessed through Pro's anaconda distribution. No clue how or what server uses, let alone Linux