When working on data processing projects with ArcGIS Desktop (non-Pro version), extending arcpy functionality often requires installing third-party libraries. Since Python 2 doesn't include pip by default, this guide outlines the installation process.
Prerequisites
- Install ArcGIS Desktop
- Add Python path to environment variables (e.g.,
C:\Python27\ArcGIS10.X
) - Remove other Python paths from system variables
Installation Workflow
Step 1: Install setuptools
- Download
setuptools-12.0.1.tar.gz
Unzip and navigate to directory in Command Prompt:
cd /d C:\your\setuptools\path
Execute installation:
python setup.py install
Step 2: Install pip
- Download
pip-1.5.4.tar.gz
Navigate to directory:
cd /d C:\your\pip\path
Install pip:
python setup.py install
Installing Third-Party Libraries
Online Installation (Internet-connected environments)
pip install library_name
Offline Installation (Intranet environments)
Download wheel files using mirror sites:
pip download -i https://pypi.tuna.tsinghua.edu.cn/simple/ pypinyin -d "E:\Temp" # Alternative mirror: pip download -i https://mirrors.aliyun.com/pypi/simple/ pypinyin -d "E:\Temp"
Install downloaded wheels:
cd /d E:\Temp pip install typing-3.10.0.0-py2-none-any.whl pip install enum34-1.1.10-py2-none-any.whl pip install pypinyin-0.51.0-py2.py3-none-any.whl
Reference Resources
https://pan.baidu.com/s/1L2Kz3wUcwld0wfh7kbcMiA?pwd=GIS6
Extraction code: GIS6