Select to view content in your preferred language

Use arcpy to Set Current License Level in Pro

949
6
08-15-2023 09:41 AM
MatthewGeorge
Frequent Contributor

I'd like to be able to set the users license level using arcpy (ArcGIS Pro). This was possible by using import arcedit/arcinfo/arcview in the python 2 implementation of arcpy. It's extremely useful, particularly when managing limited concurrent licences.

Tags (1)
0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

Pro's licensing is handled differently than ArcMap's which is why you probably found the arcpy CheckProduct method but no SetProduct (it is in the geoprocessor module ... gp.setProduct )

Licenses and extensions access in Python—ArcGIS Pro | Documentation

I doubt that esri will roll back the changes.

on a side note, the import arcinfo, arceditor etc are located in this folder

C:\...Your Install Folder ...\Resources\ArcPy

which also contains the arcpy folder which is imported when you .... import arcpy

You might want to have a look and see which verison of arcgisscripting is instantiated if you imported one of those


... sort of retired...
mody_buchbinder
Frequent Contributor

Unlike ArcMap the Pro license is by user and not by machine.

If you set user A to basic and user B to standard and you run your stand alone python under user B it should work.

If you run your script inside Pro (as GP tool or in python window) it will use Pro license but this is just like ArcMap.

Have fun

0 Kudos
MatthewGeorge
Frequent Contributor

Thanks for the info.

I understand that licensing is by user. So what you're saying is that using import <license level> for a script tool run within Pro will work then?

0 Kudos
mody_buchbinder
Frequent Contributor

 import <license level> does not work at all for arcpy 3.x

The only way to control license level for stand alone script is to run it under a user that have the needed license setting

0 Kudos
MatthewGeorge
Frequent Contributor

Which is exactly what I want to avoid. We have users that technically have access to a higher license level but we want to control the way they check it out - only check out a standard or advanced license for certain script tools and then back to basic on completion without relying on the user to do it for us.

0 Kudos
MatthewGeorge
Frequent Contributor

Moving to Python Ideas forum.

0 Kudos