How-To - Use ArcFM with Python and ArcGIS 64-bit Background Geoprocessing

Version 4

    Solution


    With 10.1 SP1 Esri is now providing an installer to enable 64-bit scripting and background geoprocessing, including when using Python. The ArcGIS for Server installation is also 64-bit only and also provides a 64-bit version of Python. Installing these components will swap out the Start menu shortcuts for Esri's geoprocessing-enabled Python environment with the 64-bit version of Python this extension provides, as well as registering .py scripts with this new environment. Any Python scripts you may have that try to access the ArcFM Python interop will fail as that code is still at 32-bit. To restore 32-bit Python functionality as the default and get access to ArcFM functionality again, you'll need to make some changes to the Python configuration and shortcuts:

     

    1. Modify the ArcGIS Python Start menu shortcut's Target value (or a copy of the shortcut) to

              C:\Python27\ArcGISx3210.1\pythonw.exe "C:\Python27\ArcGISx3210.1\Lib\idlelib\idle.pyw"

              for ArcGIS 10.1 or

              C:\Python27\ArcGIS10.2\pythonw.exe "C:\Python27\ArcGIS10.2\Lib\idlelib\idle.pyw"

              for ArcGIS 10.2.

    1. In the Control Panel, go to the Default Programs entry and select "Associate a file type or protocol with a program". Scroll down to the Python extensions .py, .pyc, and .pyo, changing them to use the 32-bit Python command line executable at C:\Python27\ArcGISx3210.1\python.exe for 10.1 or C:\Python27\ArcGIS10.2\python.exe for 10.2.
    2. Continue to use the 32-bit version of the Win32 Extensions for Python. Although installing the 64-bit version of the extensions will work in the 64-bit version of Python that Esri installs, the dispatch commands won't be able to find any 64-bit ArcFM code to execute.


    Both steps 1 and 2 need not be done, but at least one of them should be changed so some method is available to access and use the 32-bit Python environment.