Select to view content in your preferred language

ArcGIS Pro Python script does not run / no error messages

456
6
Jump to solution
09-01-2025 04:29 AM
Labels (1)
magdatopa_ratp
Occasional Contributor

Hi everyone,

I developed an ArcPy script that automatically generates a map based on various parameters.

This script works perfectly in standalone mode.

However, when I try to create an ArcToolbox tool that calls this script, it doesn't work. I did use arcpy.GetParameterAsText() to retrieve my variables and correctly defined the expected variable types. When I run the script in ArcGIS Pro (3.5) the script is said to be executed successfully (in just one second, which is suspicious), and I don't get any error messages, yet nothing happens. I don't understand why there are no error messages...

Any ideas on what might be wrong? Did I forget a crucial step when linking my script to the ArcToolbox?"

Thank you in advance. 

Magda

0 Kudos
1 Solution

Accepted Solutions
magdatopa_ratp
Occasional Contributor

Hi all,

First of all: thanks for trying to help me.

I think I found out what is wrong...and it is not the script after all 😉

I made a test with a new script I found on the Internet. It is a super short and simple one: it didn't work either in ArcGIS Pro 3.5 with no error messages (just like my original script).

Then I realized (completely by chance) that I have 2 versions of ArcGIS Pro installed on my PC which is not normal. I suspect there was an issue when I upgraded ArcGIS Pro from 3.0 to 3.5.

Interestingly this new script runs perfectly in ArcGIS Pro 3.0 so I'm confident my original script will  also run  in ArcGIS Pro 3.0. I'll test this afternoon then I will uninstall and re-nstall ArcGIS Pro to keep only version 3.5.

I'll keep you posted.

 

 

View solution in original post

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

what type of toolbox? (python or custom)

A quick tour of creating tools with Python—ArcGIS Pro | Documentation

A custom is easier to follow so do the reading in the sections below in the link above and show/elaborate on the parameters you set up.

To assess flow of the toolbox, you can use arcpy.AddMessage to emulate print statements so you can get some feedback


... sort of retired...
magdatopa_ratp
Occasional Contributor

Hi Dan,

Thank you for your help.

It's a custom ArcToolbox. 

I've used some arcpy.AddMessage() but there are no messages printed .That's really weird, I'm losing my mind trying to figure out what I made wrong.

I'll read carefully the documentation you provided by the link you provided and keep searching.

Thank you again.

0 Kudos
DanPatterson
MVP Esteemed Contributor

Set script tool parameters—ArcGIS Pro | Documentation

perhaps a screengrab of your parameters and a code listing would help

Code formatting ... the Community Version - Esri Community

As for the "print" you have to look at the Messages section when you run the tool


... sort of retired...
0 Kudos
AlfredBaldenweck
MVP Regular Contributor

Code sample would be helpful here for sure.

0 Kudos
magdatopa_ratp
Occasional Contributor

Hi all,

First of all: thanks for trying to help me.

I think I found out what is wrong...and it is not the script after all 😉

I made a test with a new script I found on the Internet. It is a super short and simple one: it didn't work either in ArcGIS Pro 3.5 with no error messages (just like my original script).

Then I realized (completely by chance) that I have 2 versions of ArcGIS Pro installed on my PC which is not normal. I suspect there was an issue when I upgraded ArcGIS Pro from 3.0 to 3.5.

Interestingly this new script runs perfectly in ArcGIS Pro 3.0 so I'm confident my original script will  also run  in ArcGIS Pro 3.0. I'll test this afternoon then I will uninstall and re-nstall ArcGIS Pro to keep only version 3.5.

I'll keep you posted.

 

 

0 Kudos
magdatopa_ratp
Occasional Contributor

Hi everyone,

It is confirmed that the problem is not my script.

I made my tests in ArcGIS Pro 3.0 and the script runs well.

0 Kudos