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
Solved! Go to Solution.
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.
Setting the environment variable to Viewer, Editor, or Professional before importing arcpro will change the result of running arcpy.ProductInfo().
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.
Setting the environment variable to Viewer, Editor, or Professional before importing arcpro will change the result of running arcpy.ProductInfo().
.