Setting Up A Python Environment
with Anaconda
Setting Up A Python Environment
with Anaconda
The initial set-up involves several steps, but should only have to be done once.
Install Anaconda
The first step is to download and install either Anaconada or Miniconda. Consider Python v3.6 to match the ArcGIS Pro python distribution. However, later versions, specifically v3.9 are known to work with with the Diversion-Runoff Calculator (DRC).
Create a Python Environment
After Anaconda is installed, you'll need to set up a GDAL environment. Go to your search bar and type “Anaconda Navigator”. Once open, select “Environments” on the left side of the screen.
In the bottom of the screen select the option to “Create”.
Create a new environment, giving it a descriptive name following the example shown below. Once the prompt is filled out, select “Create”.
There is a pull-down option menu towards the middle of the screen. Choose “Not installed”. In the search bar type “gdal”. Click the “gdal” box as shown below and then click “Apply” in the bottom right corner. Click “Apply” again if prompted to install any additional packages.
Close the Anaconda Navigator.
Install Additional Libraries
Go to your search bar on your computer and type “Anaconda Prompt”. Select the Anaconda Prompt App, which may be labeled “Anaconda Prompt (anaconda3)”.
To activate the environment created above by typing: activate pygdal_36 and hitting enter.
Notice that “base” on the left side of the prompt changes to “pygdal_36”.
Now install 'pandas', 'matplotlib', and 'openpyxl'. To do this, type the following commands into the terminal (as shown in figure above), hit enter, and then type “y” and then enter when prompted.
conda install -c anaconda pandas
conda install -c conda-forge matplotlib
conda install openpyxl
Once all libraries are installed, you are ready to begin running the DRC.