How To: Modify the Python installation to work with custom built C extensions for use with ArcMap.exe


The following information is specific to any Python developers who have installed a third-party Python module through any of the following:
-setup.py install
-pip install
The Python build process for C extensions in distutils strips the Visual C++ Runtime dependency from its embedded manifest. Since ArcMap.exe works as a side-by-side application, the interaction between the two fail to find the MSVC runtime DLL, which causes the module to fail on import.


The C extensions that are built manually do not work with ArcMap.exe, but do work with Python.exe.

This applies only to the extensions that are built manually from 2.6.5 and includes .pyd files as part of their install. There are no problems with pure Python code or anything built on 2.6.2.

  1. Backup the msvc9compiler.py file found at C:\Python26\Lib\distutils\ to a known location.
  2. Overwrite the msvc9compiler.py (version 2.6.2) with the version available here (msvc9compiler.py).

Related Information