<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Programmatically access user's Esri Python path in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774389#M757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the registry path&amp;nbsp;HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro\PythonCondaRoot to retrieve the python root folder used by Pro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Oct 2020 21:08:57 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2020-10-07T21:08:57Z</dc:date>
    <item>
      <title>Programmatically access user's Esri Python path</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774388#M756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm creating a CoreHost app that needs to be able to call ArcPy scripts. To do this, we need (from what I understand) to know the local machine's python path - specifically the path of the python .exe&amp;nbsp;installed with Arc Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've accomplished this on my development machine by just hardcoding the path to the ArcGIS directory in Program Files - but how can we get the appropriate executable without knowing where and how the user has installed Arc Pro?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2020 20:25:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774388#M756</guid>
      <dc:creator>DavidLaMartina</dc:creator>
      <dc:date>2020-10-07T20:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically access user's Esri Python path</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774389#M757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the registry path&amp;nbsp;HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro\PythonCondaRoot to retrieve the python root folder used by Pro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2020 21:08:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774389#M757</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-10-07T21:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically access user's Esri Python path</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774390#M758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works on a local machine, I don't know how you can access that information on another machine&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; sys
sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;executable
&lt;SPAN class="string token"&gt;'C:\\arc_pro\\bin\\Python\\envs\\arcgispro-py3\\python.exe'&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In my&amp;nbsp; case, arcgis pro is installed in the c:\arc_pro folder&lt;/P&gt;&lt;P&gt;Addendum&amp;nbsp;&lt;/P&gt;&lt;P&gt;which yields the same as the registry if you parse the \\envs... onward off&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:40:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774390#M758</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-12T08:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically access user's Esri Python path</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774391#M759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/10927" target="_blank"&gt;Wolfgang Kaiser&lt;/A&gt;‌. For others interested, this is the code I used to grab the path from the registry key Wolfgang provided:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;RegistryKey arcGISProInstallDirectoryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcGISPro");
 object pythonDirectoryKeyValue = arcGISProInstallDirectoryKey.GetValue("PythonCondaRoot");
 string pythonDirectoryPath = pythonDirectoryKeyValue.ToString();

string localExecutablePath = @"Scripts\propy.bat";
 string pythonExeutablePath = Path.Combine(pythonDirectoryPath, localExecutablePath);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/programmatically-access-user-s-esri-python-path/m-p/774391#M759</guid>
      <dc:creator>DavidLaMartina</dc:creator>
      <dc:date>2021-12-12T16:54:13Z</dc:date>
    </item>
  </channel>
</rss>

