2

ArcGIS Pro uses Python 3 whereas the other ArcGIS for Desktop applications (ArcMap, ArcCatalog, ArcScene and ArcGlobe) use Python 2 and

the changes introduced with ArcGIS Pro were significant enough to merit a module name space change. The new name also offers more flexibility in terms of the capabilities arcpy.mp can offer. For example, in addition to map automation, arcpy.mp can also provide project level management.

Is there an Esri recommended way to refer to the ArcPy site-package that is imported into Python 3, that enables it to be distinguished during communication between ArcPy developers from the ArcPy site-package that is imported into Python 2?

It is clearly not identical (although it may be very similar) because when I run the script below on a machine that has both ArcGIS 10.3.1 and ArcGIS Pro 1.1.1 installed, from Python 2 vs Python 3, two different results occur.

import arcpy

if arcpy.Exists("C:/Temp/test.gdb"):
    arcpy.Delete_management("C:/Temp/test.gdb")
arcpy.CreateFileGDB_management("C:/Temp", "test", "CURRENT")
arcpy.CreateFishnet_management("C:/Temp/test.gdb/TestFC",
                               "0 0","0 1","1","1","2", "2",
                               "","NO_LABELS","DEFAULT","POLYGON")
arcpy.MakeFeatureLayer_management("C:/Temp/test.gdb/TestFC","TestFC_Layer")
arcpy.MakeTableView_management("C:/Temp/test.gdb/TestFC","TestFC_View")
arcpy.CopyRows_management("TestFC_View","C:/Temp/test.gdb/TestTable")
arcpy.AddRelate_management("TestFC_Layer", "OID", "C:/Temp/test.gdb/TestTable", "OBJECTID", "test_relate")

If you put the above code into a Python script and run it using IDLE 2.7.8 the result is:

Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 

Traceback (most recent call last):
  File "C:\Temp\test.py", line 12, in <module>
    arcpy.AddRelate_management("TestFC_Layer", "OID", "C:/Temp/test.gdb/TestTable", "OBJECTID", "test_relate")
AttributeError: 'module' object has no attribute 'AddRelate_management'
>>> 

I expected this because ArcPy, when used with ArcGIS 10.x for Desktop from Python 2, does not have an Add Relate tool.

If you put the above code into a Python script and run it using IDLE 3.4.1 the result is:

Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:45:13) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 
>>> 

i.e. it worked!

I expected this too because ArcPy, when used with ArcGIS Pro from Python 3, does have an Add Relate tool.

When ArcGIS users are communicating between themselves about ArcPy since the release of ArcGIS Pro, there seems not to be a recommended way to describe the distinction.

Often it may be possible to tell from context, but in at least one question here (Add/Remove Relate using ArcPy without ArcGIS Pro?), which led to this one, the precise context within which the term ArcPy is being used was not initially clear, and which it was would lead to very different answers.

When working with ArcGIS, I always prefer to use the terminology that Esri uses, in order to be respectful to its developers, and I do the same for any development team.

Perhaps when you use/test ArcPy and want to communicate what you did with another ArcPy developer, like I have tried to in this question, then you just need to be careful to say:

  1. whether ArcGIS Pro and/or ArcMap etc is installed; and/or
  2. whether you are testing/using the script against Python 3 and/or Python 2

Much ArcPy code will run successfully without knowing the above (the first seven lines in my test above did), but as illustrated in the test code and procedure, some will not.

I think that I am going to have to say either:

  • for this test/tool/application I used ArcPy with Python 2 and the ArcGIS 10.x architecture; or
  • for this test/tool/application I used ArcPy with Python 3 and ArcGIS Pro

If Esri were using terminology like "ArcPy" and "ArcPy Pro" (as an example) then we would have a concise way to make the distinction but, from comments and an answers here, that path has not been taken.

  • 5
    Is this being asked to create more tags? Arcpy is arcpy. It's the product you're using arcpy against which could possibly count. Head to stackoverflow and look at urllib which under went big changes between py2 and py3. It's still urllib, it's just the referring Python version that's different – KHibma Dec 7 '15 at 4:52
  • 3
    And no, to my knowledge nothing on external Esri sites, nor internally do we call it anything other than arcpy. If in conversation it's unclear we add the product (10 or pro) name to the discussion. – KHibma Dec 7 '15 at 4:54
  • 4
    This is fantastically, incredibly pedantic and assumes a taxonomy that simply does not exist – Jason Scheirer Dec 8 '15 at 1:44
  • 1
    Thus far, myself and other arcpy developers don't have enough functions in ArcGIS Pro, and haven't gotten into ArcPy 3 much. I think this is a good question for once we DO start getting into writing and rewriting a significant number of scripts, though :) – Erica Dec 8 '15 at 14:36
  • 1
    We have started to have terminology issues in my shop when wording on both 10 and pro with python – If you do not know- just GIS Dec 19 '15 at 4:23
3

It should be references as 'ArcPy'. ESRI resources available after the release of Pro don't differentiate between versions of python, other than with regard to the software in use, e.g:

Install Python for ArcGIS Pro

Analysis & Geoprocessing in ArcGIS Pro: FAQ

ArcGIS Pro ArcPy Reference

2

The contribution that I think helps answer this the most is the comment by @khibma:

to my knowledge nothing on external Esri sites, nor internally do we call it anything other than arcpy. If in conversation it's unclear we add the product (10 or pro) name to the discussion.

To save having to write a sentence each time I am working with an aspect of ArcPy, in my day to day work, and I know or suspect it differs when in an ArcGIS Pro context, I will probably describe it as "ArcPy with ArcGIS Pro" or "ArcPy with Pro" (for short), and let people assume that I am talking about ArcPy with an ArcGIS 10.x architecture any time that I do not qualify it that way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.