Configure ArcGIS Python Environment
Configure ArcGIS Python Environment
ArcGIS Pro is not required to run the DRC, but it is the preferred platform due its geospatial capabilities and integration with Python via the ArcPy package. Because of this, ArcGIS Pro provides the most user-friendly setup option.
Still, the DRC requires several python packages that are not included in the standard ERSI environment. The DRC will attempt to install missing packages, however, it is best to work within a cloned environment to avoid changes to the built-in environment that is tightly linked to ArcGIS's internal components. Modifying that default environment can cause ArcGIS tools to behave unpredictably or stop working.
Cloning the standard arcgispro-py3 environment creates a safe copy where the additional packages required by the DRC tool can be installed without affecting ArcGIS Pro itself. Activating the clone tells ArcGIS Pro to use that copy when running the tool. This approach keeps ArcGIS Pro stable, ensures required packages work correctly together, avoids conflicts and hard-to-diagnose errors, and makes the setup repeatable and easier to fix if needed.
Note, it is possible to perform all the necessary functions outside of an ArcGIS environment, however, the process is more involved and requires a standalone Python environment.
Create a new python environment by cloning the existing ESRI distribution using 'SetupEnv.bat'.
Use the shortcut installed with ArcGIS Pro:
Start Menu → ArcGIS → ArcGIS Pro Python Command Prompt
Do not use:
Anaconda Prompt
PowerShell
CMD launched outside ArcGIS Pro
From the ArcGIS Pro Python Command Prompt:
cd <path to this repository>
SetupEnv.bat
What this does:
Preserves ArcGIS Pro’s Python and core libraries
Clones the Esri-managed arcgispro-py3 environment into a user-local environment
Installs all required DRC dependencies from drc_addons.yml
Locks Python to the version required by ArcGIS Pro (3.6.1 → Python 3.13)
This may take several minutes the first time.
Example:
cd /d "C:\Path\To\Your\DRC_Lite_Folder"
dir
Make sure you can see drc_addons.yml in that folder.
set "ENV_NAME=arcgispro-ucraf-py3"
set "ENV_DIR=%LOCALAPPDATA%\ESRI\conda\envs\%ENV_NAME%"
set "YAML_FILE=%CD%\drc_addons.yml"
(Optional sanity check)
echo %ENV_DIR%
echo %YAML_FILE%
Check if it exists:
if exist "%ENV_DIR%\python.exe" (echo Env exists) else (echo Env missing)
If it’s missing, clone:
conda create --clone arcgispro-py3 --prefix "%ENV_DIR%" --pinned -y
activate "%ENV_DIR%"
conda env update --prefix "%ENV_DIR%" --file "%YAML_FILE%"
After SetupEnv.bat completes type:
VerifyEnv.bat
This check confirms:
The correct Python interpreter is being used
ArcPy imports correctly
All required DRC dependencies import successfully
If this step fails, do not proceed — rerun SetupEnv.bat or contact support with the verification output.
This matters because the script explicitly checks that both conda and activate are available on PATH.
VerifyEnv.bat assumes VerifyEnv.py is in the same folder as the batch file, so you want to be in that folder (or at least know the full path to the .py).
Example:
cd /d "C:\Path\To\Your\DRC_Lite_Folder"
dir
Confirm you see:
VerifyEnv.py
(optional) VerifyEnv.bat
set "ENV_NAME=arcgispro-ucraf-py3"
set "ENV_DIR=%LOCALAPPDATA%\ESRI\conda\envs\%ENV_NAME%"
set "VERIFY_PY=%CD%\VerifyEnv.py"
Quick echo check (optional but useful):
echo %ENV_DIR%
echo %VERIFY_PY%
where conda
If that prints “INFO: Could not find files…”, you’re not in the ArcGIS Pro Python Command Prompt.
where activate
Similarly, if it can’t find it, it's the wrong prompt.
The batch checks for:
%ENV_DIR%\python.exe
You can do:
dir "%ENV_DIR%\python.exe"
If it says “File Not Found”, the environment isn’t there and your client must run the setup steps first (your SetupEnv.bat equivalent).
dir "%VERIFY_PY%"
If it’s missing, they’re in the wrong folder or the file wasn’t copied alongside the batch.
activate "%ENV_DIR%"
If activation fails, that usually means:
the env doesn’t exist (step 6 would have caught it), or
activate isn’t available (wrong prompt).
Ensure the UCRAF Toolbox is added to the project. If not, perform the following steps.
Open a new project in ArcGIS Pro
Add the toolbox:
Catalog pane → right click on... "Toolboxes"
Navigate to: C:/UCRAF_ControlTool/ArcGIS/ArcToolbox/ (or whatever path leads to the UCRAF_ControlTool repo)
Select: UCRAF.atbx and hit 'OK'.
Add the UCRAF Toolbox (UCRAF.atbx) to the project in ArcGIS Pro.
The UCRAF Toolbox should now appear in the 'Catalog Pane'.
Once setup is complete, no further environment work is required.
Open ArcGIS Pro
Add the ArcGIS Toolbox (UCRAF.atbx)
Run the DRC via the 'Run DRC' tool within the UCRAF.atbx
The toolbox will automatically invoke the correct Python environment
No additional setup is required for future runs.
If the environment is missing or broken, the DRC will fail early and clearly with instructions to rerun SetupEnv.bat. In that case:
Remove the corrupted environment with conda remove --name arcgispro-ucraf-py3 --all
Re-Run SetupEnv.bat
Re-Run VerifyEnv.bat
Retry the tool
ArcGIS Pro: 3.6.1
Python: 3.13 (managed by ArcGIS Pro)
OS: Windows (ArcGIS Pro standard)
C:/UCRAF_ControlTool/DRC Files/DRC Source Code/
UCRAF.atbx — ArcGIS Toolbox containing the UCRAF-DST tools
DRC_Lite.py — Core DRC execution script
SetupEnv.bat — One-time environment setup
VerifyEnv.bat / VerifyEnv.py — For verifying the environment
drc_addons.yml — Locked add-on dependency list
Open ArcGIS Pro and add UCRAF.atbx.
Prepare required spatial and tabular inputs (e.g. specify change cases).
Run DRC Controller for the base & change cases to generate ObservedAndDRCDiversions.xlsx (RiverWare input).
Run RiverWare Controller
Visualize results in PowerBI.