Python script fails to run a model

401
4
02-01-2018 01:36 AM
abdullahqasrawi
Occasional Contributor

I am Trying to run a model by using python script, but an error occurs while running the model by python script despite the fact that the model working fine when I running it directly from ArcMap.

Please see the screenshots below

 

what might be the issue here?

0 Kudos
4 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Are there any values for the parameters? the first one says it doesn't exist?

0 Kudos
abdullahqasrawi
Occasional Contributor

Dear Dan Patterson

There are no parameters, all the values were defined internally.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

when run as a standalone script, the script has no idea if there are any selections in the data, hence, there is no inputs since you didn't use an sql expression

http://pro.arcgis.com/en/pro-app/tool-reference/analysis/select.htm

if your intent is to just copy the data to a new location, then the help topic suggests using the Copy tool.

The model runs within the toolbox within ArcMap or Pro, because it knows of the existence of selections on the data.  The minute you run the script from outside in a standalone python IDE, the knowledge of what is selected and not selected is not known.  To fix this, you would need to provide an sql expression in order to get a 'selection'

0 Kudos
AhmadSALEH1
Occasional Contributor III

Abdallah,

 Your model uses field calculator   to populate some fields, right? 

in that case try to change the expression type in the field calculator  from VB to Python and it will work with you.