Skip to main content
Question

Python packages in ArcGIS Pro Conda environment on FME Server


johnnygalambos
Contributor
Forum|alt.badge.img+2

I am trying to run a Python Caller in a workbench on FME Server 2018.1 which imports both

  • arcpy (ArcGIS Pro 2.3 is installed on the server and I'm running in compatibility mode Esri ArcGIS Pro 2.1/2.2/2.3 (Python 3.6))
  • pymssql (3rd party SQL Server package not installed in the base argispro-py3 Conda environment)

As of the later releases of ArcGIS Pro, packages can only be installed in clones of the base argispro-py3 Conda environment. I have created a cloned environment and installed pymssql there. Is there any way to direct FME Server to use that specific environment when running the workbench? It picks up the base arcgispro-py3 environment which is missing the pymssql package. I'm hoping to not override server wide Python settings if possible as there are already many Python scripts being executed on FME Server I'm deploying to and I'm hoping to avoid breaking them.

2 replies

nathanatsafe
Safer
Forum|alt.badge.img+7

HI @johnnygalambos, thanks for the question.

 

 

I haven't worked with ArcPro cloned Python environments but I imagine this should be possible to set up as long as the FME Engines know about the Python environment you want to use. At the end of this documentation page there is a section titled "Changing the Python Interpreter" - following those instructions should add the Python path for your custom interpreter to the FME Engines path. You can check this by printing the system path from a job running on FME Server.

 

 

Eg.

 

 

import sys

 

print(sys.path)

 

 

You may also append the path to your custom interpreter directly in your script with:

import sys

 

sys.path.append(<path to python>)

 

 

I believe your workspace will need to have the appropriate interpreter set as a workspace parameter as well. A good start might be to try to set up your workspace to run in FME Workbench on your FME Server machine before publishing to FME Server and setting up the FME Engines to use the interpreter.

 

 

Hope this helps

 

Nathan

johnnygalambos
Contributor
Forum|alt.badge.img+2
nathanatsafe wrote:

HI @johnnygalambos, thanks for the question.

 

 

I haven't worked with ArcPro cloned Python environments but I imagine this should be possible to set up as long as the FME Engines know about the Python environment you want to use. At the end of this documentation page there is a section titled "Changing the Python Interpreter" - following those instructions should add the Python path for your custom interpreter to the FME Engines path. You can check this by printing the system path from a job running on FME Server.

 

 

Eg.

 

 

import sys

 

print(sys.path)

 

 

You may also append the path to your custom interpreter directly in your script with:

import sys

 

sys.path.append(<path to python>)

 

 

I believe your workspace will need to have the appropriate interpreter set as a workspace parameter as well. A good start might be to try to set up your workspace to run in FME Workbench on your FME Server machine before publishing to FME Server and setting up the FME Engines to use the interpreter.

 

 

Hope this helps

 

Nathan

Hi Nathan,

I was skeptical of the custom interpreter steps because I thought they looked more geared more toward non-ArcGIS Pro Python installs and I'm hesitant to override server wide configuration for just a couple of scripts that need the ArcGIS Pro libraries. Will run this past our server admin though. I really like your second sys.path suggestion. Will give that a go and report back. Thanks for your help!

John


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings