Select to view content in your preferred language

Unable to get Standard or Advanced Concurrent Use license running python script outside ArcGIS Pro

170
2
Jump to solution
11-01-2024 05:57 AM
BobWagner
New Contributor

I have a concurrent use license and Basic, Standard, and Advanced licenses are available.  I have ArcGIS Pro open and I have a standard license set up for offline use. In my script I am importing arceditor before arcpy.  When I run the script from VS Code I get tool not licensed message on arcpy.management.RegisterWithGeodatabase.  

When I run arcpy.ProductInfo() I get ArcView.  when I run arcpy.CheckProduct I get Available for each of the license levels.

I am able to run tools that only require a Basic license level.

ArcGIS Pro version 3.1.1

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
BobWagner
New Contributor

I figured out the issue.  We use  3 different bat files to run ArcPro to switch between license levels.  In the bat file we set  an environment variable using os.environ['ESRI_SOFTWARE_CLASS_PRO'] to either Viewer, Editor, or Professional and when ArcPro starts it uses the appropriate license.  The arcpy script was not recognizing that license but whatever concurrent license was last set when just starting ArcGIS Pro without setting the environment variable.  In my case that was a basic license.  

Setting the environment variable in my script before importing arcpro solved the issue.  

import os
os.environ['ESRI_SOFTWARE_CLASS_PRO'] = 'Editor'
import arcpy


Setting the environment variable to Viewer, Editor, or Professional before importing arcpro will change the result of running arcpy.ProductInfo().

 

View solution in original post

0 Kudos
2 Replies
BobWagner
New Contributor

I figured out the issue.  We use  3 different bat files to run ArcPro to switch between license levels.  In the bat file we set  an environment variable using os.environ['ESRI_SOFTWARE_CLASS_PRO'] to either Viewer, Editor, or Professional and when ArcPro starts it uses the appropriate license.  The arcpy script was not recognizing that license but whatever concurrent license was last set when just starting ArcGIS Pro without setting the environment variable.  In my case that was a basic license.  

Setting the environment variable in my script before importing arcpro solved the issue.  

import os
os.environ['ESRI_SOFTWARE_CLASS_PRO'] = 'Editor'
import arcpy


Setting the environment variable to Viewer, Editor, or Professional before importing arcpro will change the result of running arcpy.ProductInfo().

 
0 Kudos
ShaneONeill_144
Esri Contributor

.

0 Kudos