arcpy running in Linux environment

961
5
Jump to solution
12-16-2020 08:44 PM
TueVu
by
New Contributor II

Hi esri help desk,

I am HPC facilitator and I am helping GIS group to install ArcGIS Server to our supercomputer (Running CentOS8 Linux). I have downloaded and installed the arcgis_server_81 to our CentOS8 server.

However, I cannot install arcpy as in the following link: anaconda.org/esri/arcpy, because the conda install command is only available for window system (you can clearly see the one inside), and not for Linux. I can use that command (conda install -c esri arcgis) to install arcgis without any problem for our CentOS8.

Now, I played a trick by pointing the os working directory to the location where I installed arcgis_server_81 and I can run the following command in terminal python console without problem, except the last command (it seems to be very simple command)

>>> import os
>>> os.chdir("/software/arcgis_server_81")
>>> import arcpy
>>> arcpy.ResetEnvironments()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'arcpy' has no attribute 'ResetEnvironments'

Please note that I can run this last command in my ArcGIS Pro python terminal in my Window system without any problem, so I believe the syntax is correct.

Any idea will be able to help.

Thanks a lot

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
TueVu
by
New Contributor II

I found the solutions.

The error is not from the installation process but from the authorization process between ArcGIS Server and our computer cluster. 

What I did was to login into my.esri.com using school username, create license files and download it. In /arcgis/server/tool/, use the authorization tool to configure the license file with "correct" address that I was registered with ESRI. Once the authorization process done, the following screen appears and I am able to import arcpy using conda environment created in the prior steps

TueVu_0-1613429061923.png

 

View solution in original post

5 Replies
JoshuaBixby
MVP Esteemed Contributor

From ArcGIS Server and ArcPy-ArcGIS Server | Documentation for ArcGIS Enterprise


ArcGIS includes the ArcPy site package that you can use for managing data store items and publishing service definitions with Python.


Given that ArcPy is installed with ArcGIS Server, I am a bit confused why you are trying to install it.

 

0 Kudos
TueVu
by
New Contributor II

Yes I have installed ArcGIS Server to our cluster, and ArcPy came with that. However when I load arcpy, the following error appears:

>>> import arcpy

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tuev/.conda/envs/test_arcpy/lib/python3.6/site-packages/arcpy/__init__.py", line 72, in <module>
import _initagsenv
_initagsenv.error: WSLib: failed initializing arcpy. Check if environment was activated correctly.

0 Kudos
George_Thompson
Esri Frequent Contributor
0 Kudos
TueVu
by
New Contributor II

Yes George, I use conda to install arcgis-server-py3=10.8.0. You can see the environment test_arcpy I posted in the above. However, I still have to set ARCGISHOME to the arcgis server installation folder (not the env location) since there is no init_user_param.sh file in the conda installed location.

TueVu
by
New Contributor II

I found the solutions.

The error is not from the installation process but from the authorization process between ArcGIS Server and our computer cluster. 

What I did was to login into my.esri.com using school username, create license files and download it. In /arcgis/server/tool/, use the authorization tool to configure the license file with "correct" address that I was registered with ESRI. Once the authorization process done, the following screen appears and I am able to import arcpy using conda environment created in the prior steps

TueVu_0-1613429061923.png