Running that code from Section 1.6 through the 32-bit and 64-bit versions a few times we have some sample results below. Once your script finishes you’ll have a few time stamp values. In my case that means the command is: C:\python27\ArcGIS圆410.5\python.exe myScriptName.py
To run the code against the 64-bit version of Python the command is almost identical except that you’ll use the 圆4 version of Python that has been installed by Background Geoprocessing. You will now see the code run in the command window and pop up all of the same messages you would have seen if you had run it from an IDE (but not the AddMessages messages as they are only interpreted by ArcGIS). Where myScriptName.py is whatever you saved the code from section 1.6 as. We’ll run our code using: C:\python27\ArcGIS10.6\python.exe myScriptName.py There’s a neat little feature built into the command line where you can use the TAB key to autocomplete paths so you could start typing c:\python27\a and then hit TAB and you should see the path cycling through the various ArcGIS folders. We’ll use the 32-bit Python first which should be located at c:\python27\arcgis10.6\python.exe (substitute 10.6 by whichever version of ArcGIS you have installed). If you downloaded and installed the 64-bit Background Geoprocessing from above you will have both 32-bit and 64-bit Python installed.
mine is c:\wcgis\geog489\lesson1) and see how to run the script using the command line versions of 32-bit and 64-bit Python. We’ll change the directory to where our code from section 1.6 is (e.g. dir : list the files and folders in my directory.We just need a couple of the commands listed there : We could dedicate an entire class to operating system commands but Microsoft has a good resource at this Windows Commands page for those who are interested. Usually when you open a command window, it will start in your home folder (e.g. If you’ve typically run your code in the past from within an IDE (such as PythonWin, IDLE or spyder) or from within ArcGIS you might not be aware that you can also run that code from the command line by calling Python directly.įor ArcGIS Desktop you can start a regular command prompt and, using the standard Windows commands, change to that path where your Python script is located.
Personally, I rarely use Background Geoprocessing but I do make use of the 64-bit version of Python that it installs to run a lot of my scripts in 64-bit mode from the command line. This is because it is running using a separate set of tools which are detached from the Desktop application (which is 32-bit). You'll find this link on the "64-bit Geoprocessing downloads for ArcGIS (optional)" page under Lesson 1 in Canvas.Īs Esri hint in their documentation, 64-bit processing within ArcGIS Desktop requires that the tool run in the background. Background Geoprocessing (64-bit) is still available as a separate installation on top of ArcGIS (see this ArcMap/Background Geoprocessing (64-bit) page) and we’ve provided a link for students to obtain it within Canvas. There is also a 64-bit arcpy geoprocessing library so you can run your code (any code) from the command line. Not all tools support 64-bit geoprocessing within Desktop and there are some tricks to getting it installed so you can access it in Desktop.
Esri also introduced 64-bit geoprocessing using the 64-bit Background Geoprocessing patch which was part of 10.1 Service Pack 1 as an option in ArcGIS Desktop (Pro is entirely 64-bit) to work around these memory issues for large geoprocessing tasks. It is recommended that you only read/skim through the section and check out the computation time comparison at the end without performing the described steps yourself and then loop back to it at the end of the lesson if you have free time and are interested in exploring 64-bit Background Geoprocessing in ArcGIS Desktop.Ī number of versions ago (since Server 10.1), Esri added support for 64-bit arcpy.
This section is provided for interest only - as it only applies to ArcGIS Desktop - not Pro (which is natively 64 bit).