This repository is a template for geospatial Python projects that use ArcGIS Pro 3.x (commonly 3.4+ in practice) and arcpy.
It is designed to get analysts productive quickly with minimal setup:
- VS Code is the IDE (including Git via the VS Code Source Control panel)
- The integrated terminal is configured to initialize ESRI’s Python tooling via
proenv.bat - You create a per-repo cloned environment named
.conda-arcgisfrom ESRI’sarcgispro-py3 - A smoke test verifies
arcpyis working
Authoritative ESRI guidance:
- Windows + ArcGIS Pro 3.x installed
- VS Code installed using your organization’s approved workflow
- Git installed using your organization’s approved workflow
In GitHub:
- Click Use this template
- Create a new repository in your approved org/location
In VS Code:
- Source Control → Clone Repository
- Paste your new repo URL
- Open the cloned repo
Open ArcGIS Pro Python Command Prompt (Start Menu), then run:
conda create --name .conda-arcgis --clone arcgispro-py3
This repo includes a VS Code terminal profile that runs:
C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\proenv.bat
In VS Code:
- Terminal → New Terminal
Activate the project environment:
conda activate .conda-arcgis
python scripts/smoke_test_arcpy.py
If this passes, you are ready to work.
Even if the terminal is correct, VS Code still needs the correct interpreter for:
- IntelliSense
- Running scripts via the Python extension
- Jupyter notebooks
Steps:
- Ctrl+Shift+P → Python: Select Interpreter
- Choose the interpreter for the conda env named:
.conda-arcgis - If you don’t see it:
- restart VS Code
- ensure
.conda-arcgisexists:conda env list
Verify (in VS Code terminal):
python -c "import sys; print(sys.executable)"
python -c "import arcpy; print(arcpy.__version__)"
Open:
notebooks/00_getting_started.ipynb
When prompted to select a kernel:
- choose
.conda-arcgis
notebooks/— exploratory analysis + narrativescripts/— runnable workflows / entry pointssrc/— reusable functions/modulesdata/— project data (use judgment; avoid huge files)outputs/— generated outputs (use judgment; avoid committing huge/binary artifacts)env/— environment metadata capture
Basic metadata (small):
python env/capture_env_metadata.py
Also write a pip package list (often large):
python env/capture_env_metadata.py --pip-freeze
-
If
condais not found in VS Code terminal:- open a new terminal (it should use the “ArcGIS Pro Python …” profile)
- restart VS Code
-
If
arcpyfails to import:conda activate .conda-arcgis- re-run smoke test
- Commit code, notebooks, and documentation.
- Avoid committing huge data and bulky generated outputs.