We have a large computational task we have scripted in arcpy. Our most powerful machine is an Ubuntu box so we have install ArcGIS Server on it. We have no plans to use ArcGIS Server for anything beyond running arcpy for users directly logged in to the linux box.
The person who installed ArcGIS Server has successfully gotten a conda environment going and can import arcpy. While others can install arcgis-server-py3 in a new conda environment, they cannot import arcpy.
They can activate the environment, but it gives this warning: "ERROR: Conda must be run by the ArcGIS Server install user". Since the environment is now active, they can start a Python interpreter. When they run "import arcpy" it produces a traceback that ends with, "_initagsenv.error: Xvfb: failed initializing arcpy. Check if environment was activated correctly."
This recent question asked something similar. They recommended changing the permissions for the entire /arcgis/server/ directory to rwx. I'm hoping there is a more targeted solution.
After making various targeted changes to permissions, we ended up:
We have no idea if this will have unexpected consequences, but it got arcpy working for multiple users.
Note: Activating the conda environment still gives this warning: "ERROR: Conda must be run by the ArcGIS Server install user". But this doesn't seem to have any impact on arcpy functionality. This error is generated by a file downloaded from conda, not a file in /arcgis/server/