Skip to main content

Hi,

We have a python clone in ArcGIS Pro where we have pandas and psycopg2 installed. We have a standalone script that runs fine when run in IDLE (ArcGIS Pro). We want to integrate this into a workflow in FME (preferably without using system callers etc.).

In my various testing of compatibility settings and in the main options (including setting the clone with the python home) I only ever have luck with psycopg2 as I think it installed in the FME libraries.

Anyway, I believe the correct settings are

Main Options/Translation:

imageWS Params/Scripting/Python Comp: Python 3.6+

I also explicitly set the Esri ArcGIS Comp to ArcGIS Pro too.

 

When set like this I get the following error about the "encodings" module in the log:

imageAny help would be greatly appreciated. I've not even got the bit about setting this up in FME Server!

 

Regards

 

John

I would hazard a guess that by simply copying /cloning arcpy is not going to work. it's going to cause issues like what you're seeing.

 

From my point of view, there may be other ways, I see two solutions

  1. Install the required libraries to your default arcgis python
  2. Reference the library locally - https://stackoverflow.com/questions/9059699/use-a-library-locally-instead-of-installing-it. This is likely to be fraught with issues however as you will then need to make sure all required libraries for the other library are either installed in the master python, or referenced locally

 


I would hazard a guess that by simply copying /cloning arcpy is not going to work. it's going to cause issues like what you're seeing.

 

From my point of view, there may be other ways, I see two solutions

  1. Install the required libraries to your default arcgis python
  2. Reference the library locally - https://stackoverflow.com/questions/9059699/use-a-library-locally-instead-of-installing-it. This is likely to be fraught with issues however as you will then need to make sure all required libraries for the other library are either installed in the master python, or referenced locally

 

Probably one of the best options would be using a Python VENV, but from what I can tell, FME doesn't support them currently. So here's a shameless plug for an idea I just submitted: https://community.safe.com/s/bridea/a0rDm000000D8L0IAK/python-venv


Hi @hkingsbury​ , thanks for your responses, but ideally I am looking for a response about this "encodings" error. I've followed the guidance for setting up a custom interpreter, and the ArcGIS Pro clones are valid to be used (you cannot modify the default python environment in ArcGIS Pro, but make a clone and add to then, then get ArcGIs Pro to use it - which FME picks should pick up on). I am not actually using arcpy in this instance, merely the ease of the python environment to add additional libraries that are already being used in our production environment.


Hi @hkingsbury​ , thanks for your responses, but ideally I am looking for a response about this "encodings" error. I've followed the guidance for setting up a custom interpreter, and the ArcGIS Pro clones are valid to be used (you cannot modify the default python environment in ArcGIS Pro, but make a clone and add to then, then get ArcGIs Pro to use it - which FME picks should pick up on). I am not actually using arcpy in this instance, merely the ease of the python environment to add additional libraries that are already being used in our production environment.

Looking at this: https://stackoverflow.com/questions/38132755/importerror-no-module-named-encodings

Suggests that the encoding error is due to the python copy not being in the environmental variables


Reply