Select to view content in your preferred language

How to get path of the active conda environment

456
2
Jump to solution
11-03-2022 04:08 PM
SurendraPinjala
Emerging Contributor

I am working on custom Add In in ArcGIS Pro 3.0 using ArcGIS Pro 3.0 SDK for .NET, for this I need to check if the file exists in the site-packages folder in my active (cloned) environment.

Please let me know how to find the path of the active environment in C#.Net.

Thanks.

 

 

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

You can read it from computer registry:

GintautasKmieliauskas_0-1667555183092.png

Code to read value:

RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcGISPro");
object activeEnv = registryKey.GetValue("PythonCondaEnv");
object envPath = registryKey.GetValue("PythonCondaRoot");

 

View solution in original post

2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

You can read it from computer registry:

GintautasKmieliauskas_0-1667555183092.png

Code to read value:

RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcGISPro");
object activeEnv = registryKey.GetValue("PythonCondaEnv");
object envPath = registryKey.GetValue("PythonCondaRoot");

 

SurendraPinjala
Emerging Contributor

Hi GintautasKmieliauskas,

Thank you for your message. Now I able to read the active ( cloned) environment from the Registry key HKEY_CURRENT_USER.

SurendraPinjala_0-1667575418068.png

 

0 Kudos