When extending ArcGIS Python functionality (e.g., using openpyxl for Excel integration), installing supplementary packages becomes necessary. This guide demonstrates manual and automated installation methods for both online and offline scenarios.

Manual Installation

Suitable for offline environments, manual installation requires addressing these prerequisites:

1. Verify Python Environment Variables

Ensure ArcGIS Python paths are configured in system variables:

  1. Navigate to: Control Panel → System → Advanced system settings → Environment Variables
    !https://image.malagis.com/gis/2024/20240605095333.png
  2. Edit Path under System Variables:
    !https://image.malagis.com/gis/2024/20240605095359.png
  3. Add these critical paths (Example for ArcGIS 10.2):

    C:\Python27\ArcGIS10.2        # For python.exe
    C:\Python27\ArcGIS10.2\Scripts  # For package executables

  4. Validate in Command Prompt:

    python --version

2. Package Acquisition

Download compatible packages from PyPI: https://pypi.org/

Version Selection Guidelines:

  • For Python 2.7 (ArcGIS 10.x), use openpyxl 2.6.2
  • Prefer *.tar.gz format for older Python versions
  • Download sequence:


3. Installation Procedure

  1. Extract the downloaded package
  2. Open command prompt at the setup.py directory
  3. Execute:

    python setup.py install


Dependency Note: openpyxl requires et_xmlfile and jdcal. Resolve dependency errors by installing these first.

Automated Installation

Online Method

With internet access, use pip:

pip install openpyxl

Version Considerations:

  • ArcGIS 10.x: Upgrade pip first (python -m pip install --upgrade pip)
  • ArcGIS Pro: Pre-installed packages visible at:
    ArcGIS Pro → Settings → Python

PyCharm Integration

  1. Attempt import:

    import openpyxl
  2. Click installation prompt when error appears:
  3. Alternatively use package manager:
    File → Settings → Project → Python Interpreter → +