arcpy on linux

2245
4
12-21-2016 11:56 AM
DanielPaske
New Contributor

Our users are preparing to upgrade their ESRI client tools (ArcCatalog, etc) from 10.2 to 10.4.1. Our SDE database is an Oracle 11g database (11.2.0.4) running on Oracle Linux. Our users have python scripts to register tables to the geodatabase. They would like these scripts to run on the database server instead of their client PC's. The database server has python 2.6.6 installed. I do not think the server has any SDE server products installed or running on it. 

I have tried to run a python script on the server and I get an error - "no module named arcpy" - on the "import arcpy" line of the script.

Hope this makes sense, I am new with ESRI tools and processes.

Thanks in advance,

Dan 

Tags (3)
0 Kudos
4 Replies
RebeccaStrauch__GISP
MVP Emeritus

If you really need to run them on the server with Oracle, the easiest way in my opinion would be to install the ArcGIS Desktop software on that server.  That way all the Arcpy modules and paths will be set, and the ArcGIS software will already know what python paths is has.

However, ArcCatalog on a user machine should work just as well when working with SDE databases, and is the preferred way vs external commands.

What is the reasoning behind running the commands on the Oracle server itself?

If you do need to get the Python setup on that server without installing the software, check out some of the links on /blogs/dan_patterson/2016/05/09/the-links?sr=search&searchId=f606304c-d8cc-4d09-b05c-08b3771f0a08&se...‌ and I'll cc Dan_Patterson‌ who wrote that blog and might have some suggestions.

btw - I use SDE for SQL, not Oracle, but the process should be the same.

This should probably be moved to https://community.esri.com/groups/geodatabase?sr=search&searchId=57a74b7b-e003-403a-afe7-986b8c667c5...‌ or https://community.esri.com/community/developers/gis-developers/python?sr=search&searchId=2ae99f5a-d0...‌ space (vs the esri tech support) since those areas will get more views. https://community.esri.com/docs/DOC-2258?sr=search&searchId=6f8c3648-b770-4bf2-8bec-5aedb8a8bdac&sea...     I also just @ tagged them above.

DanPatterson_Retired
MVP Emeritus

A local install of ArcMap on the server machine would be the simplest and it also ensures that the proper version of python is installed... having said that, you better check python dependencies for other programs that reside on that machine before doing anything.

If it purely a convenience issue... I would skip it ... messing with a server just so you can do import arcpy and a few trivial things doesn't seem worth the risk.  Machines are cheap... time is not

DanielPaske
New Contributor

Thank you for your quick response. The workflow for our geodatabase has

been set up so the processing is done on the database server and is a bit

complicated. This is a database process and is written in PL/SQL. The GIS

analyst creates a process to copy business data into the geodatabase. The

analyst identifies the location data elements and the process generates

geometries based on the data elements. After the data has been loaded into

the database, the new tables need to be registered with the geodatabase

before the data can be presented on maps or edited. We would like to

include registering the table to the geodatabase in the workflow. I hope

this makes sense, I am still trying to learn the programming that has been

set up for this.

I know this can be easily done in ESRI tools. But this workflow has already

been created and we have to follow it.

I will search the blog to see if I can find how to install the ArcSDE

server tools on the Linux server. Thank you again for the feedback.

On Wed, Dec 21, 2016 at 1:56 PM, Rebecca Strauch, GISP <geonet@esri.com>

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

In that case, you may want to look at https://blogs.esri.com/esri/supportcenter/2013/10/04/do-this-not-that-alternatives-to-using-sde-comm...   and some of the command line resources for ArcSDE.  Not sure how well or if they will work with 10.4.1 and Oracle, so proceed with caution.  And I really wouldn't do anything until you understand what the custom scripts you have are doing.  With the upgrade, don't assume the black box is going to work the same.  Just my opinion.