ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

SetProduct

  • Summary
  • Discussion
  • Syntax
  • Code sample

Summary

The SetProduct function defines the desktop license. SetProduct returns information on the license.

Legacy:

The product level should be set by importing the appropriate product module (arcinfo, arceditor, arcview, arcserver, arcenginegeodb, or arcengine) prior to importing arcpy. The SetProduct function is a legacy function and cannot set the product once arcpy has been imported.

For scripts using the arcgisscripting module, the equivalent SetProduct method is still supported.

Discussion

Tip:

The setting of the product and extensions is only necessary within stand-alone scripts. If you are running tools from the Python window or using script tools, the product is already set from within the application, and the active extensions are based on the Extensions dialog box.

Syntax

SetProduct (product)
ParameterExplanationData Type
product

Product code for the product being set.

  • arcview —ArcGIS Desktop Basic product code
  • arceditor —ArcGIS Desktop Standard product code
  • arcinfo —ArcGIS Desktop Advanced product code
  • engine —Engine Runtime product code
  • enginegeodb —Engine Geodatabase Update product code
  • arcserver — Server product code
String

Return Value

Data TypeExplanation
String

The function returns the status on the product license. There are four possible values:

  • CheckedOut —License successfully set.
  • AlreadyInitialized —License has already been set.
  • NotLicensed —The license is not valid or available.
  • Failed —A system failure occurred during the set request.

Code sample

SetProduct example

Sets an ArcGIS Desktop Basic product license using the arcview module.

# Set the ArcGIS Desktop Basic product by importing the arcview module.
import arcview
import arcpy

arcpy.env.workspace = "c:/data/SanDiego.gdb"

arcpy.CreateRasterDataset_management(
    arcpy.env.workspace, "LandUse", "30", "8_BIT_UNSIGNED",
    "Freeways", 1)

Related topics

  • CheckProduct
  • ProductInfo
  • Accessing licenses and extensions in Python

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal