Has anyone played around with using ArcObjects in Python at version 10.1?

I am having all sorts of problems, such as TypeErrors when wrapping the ESRI OLB modules and AttributeErrors when attempting to use a method or property of a wrapped module.

Anyone had any better luck?

  • I removed the 10.1 version specific tag because this same error and fix applies to 10.1, 10.2, and 10.3 (and we don't have a 10.x tag). Also it doesn't need arcgis tag as there aren't any arcobjects without it. Commented May 13, 2015 at 21:40

2 Answers 2


As of July 2015 release 1.1.2 comtypes has the patch from below applied. :) Install using pip from PyPi or from github:

pip install comtypes

pip install https://github.com/enthought/comtypes/archive/master.zip

There is a fix for this, taken from the ArcGIS Forums: 10.1 beta and comtypes. Edit comtypes module, under PYTHONPATH\lib\site-packages and add the following entry to the _ctype_to_vartype dictionary in automation.py:


You may also need to delete automation.pyc, automation.pyo, safearray.pyc, and safearray.pyo in the same folder.

Also see page 5 of Mark Cederholm's 2012 Dev Summit presentation: ArcMap and Python: Closing the VBA Gap, and in the header of his updated snippets modules for 10.0, 10.1 and 10.2 respectively; index page: http://pierssen.com/arcgis10/python.htm

There is a pull request to merge the patch into master comtypes; still open because Enthought (rightly) won't apply patches without accompanying tests.

  • +1 Unfortunately, this doesn't fix everything, though. calling comtypes.client.GetModule on esriDataSourcesOleDB.olb, esriGlobeCoreUI.olb, and esriSchematicControls.olb still generates attribute errors. Furthermore, the coclasses that should be accessible in esriFramework.olb (such as AppROT), aren't. Commented Jul 16, 2013 at 19:00
  • Anyone tried this fix for 10.2 with results?
    – Conor
    Commented May 7, 2014 at 15:19
  • 1
    Works fine for me with the above fix.
    – blah238
    Commented May 7, 2014 at 15:22
  • Fix above worked for me in 10.2, Thanks @blah238
    – dklassen
    Commented Jul 7, 2014 at 22:46
  • 1
    I submitted a pull request to the comtypes project on GitHub: github.com/enthought/comtypes/pull/75. If this fix is applied upstream we won't need to do this anymore. Commented Jan 15, 2015 at 20:34

To gain access to arcobjects (10.1) via python I had to delete automation.pyc, automation.pyo, safearray.pyc and safearray.pyo in the comtypes directory. I also deleted all of the files in the C:\Users\USER_ID\AppData\Roaming\Python\Python27\comtypes_cache and had to change the

ProductList = [esriSystem.esriLicenseProductCodeArcInfo, esriSystem.esriLicenseProductCodeArcEditor, esriSystem.esriLicenseProductCodeArcView]

to [esriSystem.esriLicenseProductCodeAdvanced, esriSystem.esriLicenseProductCodeStandard, esriSystem.esriLicenseProductCodeBasic].

The last thing that I did was search the syntax for all “10.0” strings and replaced them with “10.1”.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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