Solved

Any update on 'ArcPy "import" statement tries to perform import action?'


Badge

Hi, the question

ArcPy "import" statement tries to perform import action?

https://knowledge.safe.com/questions/37659/arcpy-import-statement-tries-to-perform-import-act.html

was raised in 2016 and doesn't appear to have a satisfactory answer.

I have been experiencing the issue this week - adding import arcpy to the top of a PythonCaller. When the Workspace hits the python it hangs for 10 seconds then spits out thousands of lines (red, black and blue) around Autodesk 3DS before going on to successfully complete.

While it is great that my Workspace runs successfully, it takes a couple of minutes when it should be just a few seconds.

I am on FME Desktop 2018.1.1.0, ArcGIS 10.2 (Server is 10.0), running Python (ArcPy) 2.7. Environment variables are set and FME is looking at the right location in Options.

Cheers,

Mark

 

icon

Best answer by debbiatsafe 14 June 2019, 23:59

View original

6 replies

Badge

Just for fun, I removed import arcpy and the associated SDE search function and replaced them with import csv and a csv reader. Process ran (without error) in 8 seconds.

Badge

I lodged this as a ticket (C145760) and have received some useful feedback.

Apparently the 'errors' only affect ArcGIS 10.2 and my tests in 10.6 confirm their absence.

The 'import arcpy' statement still introduces a 10 second lag (more with data interop/reviewer installed) and trawling SDE or Geodatabase connections for an address match is also painfully slow.

Our solution (beyond the thrice weekly cadastral update into a csv file) is to access a view on the enterprise oracle database - this should prove exceedingly fast.

Badge +8

Have you set your Python Compatibility for the workspace to ArcGIS Desktop? Have you set your python interpreter for workbench (tool/options) to that as well?

Userlevel 3
Badge +17

Some more details in case another user runs into the same error messages. The statement import arcpy in a PythonCaller or in a Startup Python Script parameter will cause multiple instances of a similar error as the following to occur:

3DS Reader: Failed to load file: 'C:/Program Files (x86)/ArcGIS/ArcGISDataReviewer/Desktop10.2/ArcToolbox/Toolboxes/Data Reviewer Tools.tbx'3DS Reader: Error opening the dataset: 'C:/Program Files (x86)/ArcGIS/ArcGISDataReviewer/Desktop10.2/ArcToolbox/Toolboxes/Data Reviewer Tools.tbx'

This issue occurs on machines where the ArcGIS Data Interoperability extension in combination with another ArcMap extension is installed with ArcGIS Desktop 10.3 and older.

Note that the translation will still complete successfully but the log file will be cluttered with extra errors and warnings. If these additional errors or warnings are a problem, please try one of the following workarounds:

  • Upgrading the ArcGIS installation including extensions to 10.3.1 and higher
  • Uninstalling the Data Interoperability extension
  • Uninstalling additional ArcMap extensions (eg. Data Reviewer, etc.)

If the error still persists after doing one of the above or if you need additional assistance, please contact Safe support via https://www.safe.com/support/report-a-problem/

Badge

Some more details in case another user runs into the same error messages. The statement import arcpy in a PythonCaller or in a Startup Python Script parameter will cause multiple instances of a similar error as the following to occur:

3DS Reader: Failed to load file: 'C:/Program Files (x86)/ArcGIS/ArcGISDataReviewer/Desktop10.2/ArcToolbox/Toolboxes/Data Reviewer Tools.tbx'3DS Reader: Error opening the dataset: 'C:/Program Files (x86)/ArcGIS/ArcGISDataReviewer/Desktop10.2/ArcToolbox/Toolboxes/Data Reviewer Tools.tbx'

This issue occurs on machines where the ArcGIS Data Interoperability extension in combination with another ArcMap extension is installed with ArcGIS Desktop 10.3 and older.

Note that the translation will still complete successfully but the log file will be cluttered with extra errors and warnings. If these additional errors or warnings are a problem, please try one of the following workarounds:

  • Upgrading the ArcGIS installation including extensions to 10.3.1 and higher
  • Uninstalling the Data Interoperability extension
  • Uninstalling additional ArcMap extensions (eg. Data Reviewer, etc.)

If the error still persists after doing one of the above or if you need additional assistance, please contact Safe support via https://www.safe.com/support/report-a-problem/

Thanks for your assistance on this Debbi - much appreciated and at least we now know the way forward.

Badge

Have you set your Python Compatibility for the workspace to ArcGIS Desktop? Have you set your python interpreter for workbench (tool/options) to that as well?

Hi Runneals, we did ensure that our python settings were correct (PYTHONHOME environment variable too). I had several versions of python and FME installed, so tried uninstalling ArcGIS, FME and all instances of python, then reinstalling ArcGIS and FME, but the same problem persisted.

Debbi managed to replicate my issue (as did the OP in 2016) using the same setup as me (ArcGIS 10.2 + Data Interop and reviewer extensions). We have, historically, been stuck on 10.2 due to our dependency on ArcFM - which is now compatible with 10.6.1, so an upgrade is planned in coming months.

The 'errors' only delayed the process by half a second or so, but the 'import arcpy' statement in the PythonCaller (in our current environment) cause a lag of around 17 seconds. The trawl of SDE was also taking tens of seconds.

Reply