ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for 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
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Debugging Python add-ins

  • Using print statements
  • Missing tool or button
  • Testing the add-in

When an add-in fails to work, it is commonly due to a coding or syntax error in the Python script. To discover what exception is being raised, open the Python window in ArcGIS. The exception is automatically printed to the Python window, providing the exact location and cause of the error:

Traceback

Using print statements

While developing your Python add-in, you can use print statements in your Python script to print variable values and informative messages to the Python window (the print statements appear in the Python window similarly to the illustration above). Using print statements to follow your add-in process can help ensure that correct values are being generated and used and the results are valid. Print statements can be removed before sharing and deploying the add-in.

Missing tool or button

Anytime a tool or button fails to load and displays Missing on the toolbar instead of the expected icon or name, it is commonly due to a Python syntax error. Recheck your Python script for syntax errors or incorrect inputs to Python functions.

Testing the add-in

Once the errors have been discovered and fixed in your Python script, it is important to retest the add-in. This requires re-creating the .esriaddin file. See Testing an add-in for details.

Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal