Thanks for the pointers, Luke.
A follow-up on my progress. The following steps were necessary to clone
the ArcGIS Pro environment.
1. Open a Python command prompt (CMD)
This might be accessible at
Start > Programs > ArcGIS > ArcGIS Pro > Python Command Prompt
but that did not exist at that location on the system I'm using. I did a
search and found the shortcut. The shortcut properties command should be
C:\Windows\System32\cmd.exe /k C:\Program
Files\ArcGIS\Pro\bin\Python]Scripts\proenv.bat
2. Clone the environment by entering in the CMD
conda create --clone --arcgispro-py3 --name my_env --pinned
I think the name "my_env" can be whatever you want. It will take a few
minutes to clone. Various messages about copying stuff will be echoed to
std out.
3. Activate the cloned environment by entering in the CMD
activate my_env
The prompt will change to
(my_env)
indicating the new cloned Python environment is active. This also
changed the PWD in the CMD to
C:\users\hurv0001\AppData\Local\ESRI\conda\envs\my_env
note that my username on the system is "hurv0001".
I had previously set up the StreetMap Premium network data (see
https://sites.uw.edu/arcgis/2021/06/01/network-routing-resources/) so
the Network Analyst was licensed in the environment so there was no need
to check it out in the Python script. Also as suggested by Luke I
checked the “Sign me in automatically" option in ArcGIS Pro.
So far things seem to be working. I have data spread across locations in
the US: about 1600 geocoded home locations from the Strong Heart Food
Environment Study
(https://reporter.nih.gov/search/CwncwB8TrE-VlvuecgCBbA/project-details/11377066)
and over 5 million destination food-related business points from the
DataAxle data (see
https://csde.washington.edu/news-events/data-axle-business-and-consumer-data-available-on-the-uw-data-collaborative/;
https://csde.washington.edu/services/dcollab/data/) stratified by a SIC
and NAICS codes and year from 1997 to 2025. The task is to count the
number of destinations within 100 km of each home location as well as to
get the distance to the closest destination within each SIC and NAICS
type for each year. I'm using the ArcGIS ODMatrix method that generates
network-based travel time and travel distance from each origin to each
destination within a 100 km cutoff. The process also generates a simple
straight linestring between the origin and destinations, which makes it
possible to validate the outputs. It is taking about 1/2 hour to run
each iteration. It is important to set the field mapping so that the
Name attribute is taken from the unique identifier from the origins and
destinations data so when the analysis is solved it will have the
identifiers in the output, which can be used to relate back to the input
data sets.
Each SIC x year and NAICS x year stratum is its own FileGDB feature
class within a single FileGDB, named accordingly, which makes the
looping process easy to manage in terms of processing and creating
well-named outputs. The FileGDB was created from a three-layer
partitioned table in PostgreSQL/PostGIS (overall table partitioned into
NAICS and SIC partitions, each of which has partitions for each year). I
used ogr2ogr to convert from PostGIS to the FileGDB.
I can recommend using arcpy.nax rather than arcpy.na. arcpy.nax uses
much more straightforward commands and makes data handling easier with
less code.
I'd be happy to answer any questions.
------------------------------------------------------------------------
Phil Hurvitz [email protected]
------------------------------------------------------------------------
On 10/19/26 09:41, Luke Rogers wrote:
Also, this assumes you have checked “Sign me in automatically” when
singing into ArcGIS Pro…
*From:*Uw-gis-l <[email protected]> *On
Behalf Of *Luke Rogers via Uw-gis-l
*Sent:* Monday, October 19, 2026 9:41 AM
*To:* Phil Hurvitz <[email protected]>; [email protected]
*Subject:* Re: [UW-GIS-L] Python in ArcGIS Pro: authentication for
network analysis
First make sure you are using the correct conda environment. If the
default install has everything run in that, otherswise clone it and
run there. This can be done in ArcGIS Pro’s settings or using the
ArcGIS Python command window. I make a clone (arcgispro-py3-clone),
issue conda activate arcgispro-py3-clone, and then run the script there.
As long as you are signed into ArcGIS Online in ArcGIS Pro, the python
tools should authenticate and get a license for you. If you want to
make sure, use the CheckExtension
<https://urldefense.com/v3/__https:/doc.esri.com/en/arcgis-pro/latest/arcpy/functions/checkextension.html__;!!K-Hz7m0Vt54!nKYhjJFZuPlgFihWBRLGLcUTK82YDhB26wUQPNAxjY3RtGEtxQ5XshV6dPxuKmicmEffgF9OKoVClOdmSEss40ACh5GLKGY6$>
function to evaluate whether you are licensed for a particular
extension, and use the CheckProduct
<https://urldefense.com/v3/__https:/doc.esri.com/en/arcgis-pro/latest/arcpy/functions/checkproduct.html__;!!K-Hz7m0Vt54!nKYhjJFZuPlgFihWBRLGLcUTK82YDhB26wUQPNAxjY3RtGEtxQ5XshV6dPxuKmicmEffgF9OKoVClOdmSEss40ACh_oLrvZN$>
function to evaluate whether you are licensed for a particular product
level.
-Luke
*From:*Uw-gis-l <[email protected]> *On
Behalf Of *Phil Hurvitz via Uw-gis-l
*Sent:* Monday, October 19, 2026 9:09 AM
*To:* [email protected]
*Subject:* [UW-GIS-L] Python in ArcGIS Pro: authentication for network
analysis
Hi UW GIS community,
I finally get to ask a question! This is the first of what might be
several questions to you.
Does anyone have any pointers on running a Python script to run an
ODMatrix analysis? The answer to this question is not necessarily
related to the specific analysis I'm trying to run.
I have a script that is saved as a .py file and the instructions I'm
reading
(https://doc.esri.com/en/arcgis-pro/latest/arcpy/get-started/using-conda-with-arcgis-pro.html
<https://urldefense.com/v3/__https:/doc.esri.com/en/arcgis-pro/latest/arcpy/get-started/using-conda-with-arcgis-pro.html__;!!K-Hz7m0Vt54!l7wULKr18CaW82SXk7TgZmi3WY44iBra4V3cOyHGyjGxydyFa_IU-HOR04F6fbdXqUO-F7z1SWNu--UPcqQdH3AUONbAy8m8$>)
show to run as e.g.,
c:\Progra~1\ArcGIS\Pro\bin\Python\scripts\propy.bat
<file:///c:/Progra~1/ArcGIS/Pro/bin/Python/scripts/propy.bat> my_script.py
If I run this in a Windows CMD I assume Windows has no idea about my
identity as far as Esri is concerned. Therefore it won't check out a
Network Analysis extension license. How do I let the Python engine to
pass on authentication to the ArcGIS Pro engine?
Thanks for any assistance.
--
------------------------------------------------------------------------
Phil Hurvitz [email protected]
------------------------------------------------------------------------
_______________________________________________
Uw-gis-l mailing list
[email protected]
http://mailman23.u.washington.edu/mailman/listinfo/uw-gis-l