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

Editing a Python toolbox

  • Solving toolbox and tool errors

A Python toolbox (.pyt) is an ASCII file that can be edited in any text editor or Python IDE.

To edit a Python toolbox from ArcCatalog or the Catalog window, right-click on the toolbox and click Edit. When your edits are finished, your Python toolbox will be automatically refreshed when the editor is closed. Alternatively, to manually refresh a Python toolbox at any time, right-click on the toolbox and click Refresh.

By default, the Python toolbox will open in NotePad. To control the application in which the .pyt file is opened, first set your Editor in Geoprocessing > Geoprocessing Options.

Tip:

When a Python toolbox is refreshed, only the Python toolbox file itself is refreshed; any modules that are imported within the toolbox are not. To reload a module from within a Python toolbox, Python's reload function can be temporarily added.

Solving toolbox and tool errors

A toolbox icon that shows an error icon (Invalid Python Toolbox) indicates a syntax error. To see an explanation of the problem, right-click the toolbox and click Check Syntax. This opens a Python Errors dialog box, which provides the error type and line number. An error such as Parsing error SyntaxError: invalid syntax (line 40), indicates a syntax error on line 40.

A tool icon that has been replaced with an error icon (Invalid Script) indicates a failure in the tool. To see an explanation of the problem, right-click the toolbox and click Why. This opens a Python Errors dialog box, which provides the error type and line number. This will cover errors in the tool's __init__, getParameterInfo, or isLicensed methods.

Related topics

  • Creating a new Python toolbox
  • What is a Python toolbox?

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