<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294144#M67742</link>
    <description>&lt;P&gt;What's odd is that everything works error free with the code below but when I have many subfolders (drill deeper into file explorer), I get the following messages/errors:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os

workspace = arcpy.GetParameterAsText(0)
outFile = open(r"C:\temp\VectorDataList.txt", "a")
shapefiles = []

walk = arcpy.da.Walk(workspace, topdown=True, datatype="FeatureClass")

for dirpath, dirnames, filenames in walk:
    for filename in filenames:
        shapefiles.append(os.path.join(dirpath, filename))
for shapefile in shapefiles:
        desc = arcpy.Describe(shapefile)
        layerName = desc.baseName
        layerPath = desc.path
        layerDType = desc.dataType
        arcpy.AddMessage(layerName)
        arcpy.AddMessage(layerDType)
#       arcpy.MakeFeatureLayer_management (shapefile, layerName)
#       arcpy.AddMessage(arcpy.management.GetCount(layerName).getOutput(0))
        lyr_view = arcpy.MakeFeatureLayer_management (shapefile, f'{layerName}_lyr')
        arcpy.AddMessage(arcpy.management.GetCount(lyr_view).getOutput(0))
        if int(arcpy.management.GetCount(lyr_view).getOutput(0)) == 0:
            arcpy.AddMessage("EMPTY VECTOR DATASET DELETED")
            outFile.write("\n" "Filename: ")
            outFile.write(layerName)
            outFile.write("\n""Path: ")
            outFile.write(dirpath)
            outFile.write("\n" "DataType: ")
            outFile.write(layerDType)
            outFile.write("\n" "Feature Count: ")
            outFile.write(arcpy.management.GetCount(lyr_view).getOutput(0))
            outFile.write("\n" "EMPTY VECTOR DATASET DELETED")
            arcpy.management.Delete(shapefile)
            outFile.write("\n")
        else:
            arcpy.AddMessage("Nothing to Delete")
            outFile.write("\n" "Filename: ")
            outFile.write(layerName)
            outFile.write("\n""Path: ")
            outFile.write(dirpath)
            outFile.write("\n" "DataType: ")
            outFile.write(layerDType)
            outFile.write("\n" "Feature Count: ")
            outFile.write(arcpy.management.GetCount(lyr_view).getOutput(0))
            outFile.write("\n")
outFile.close()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Start Time: Tuesday, May 30, 2023 11:03:15 AM&lt;/PRE&gt;&lt;PRE&gt;Polylines&lt;/PRE&gt;&lt;PRE&gt;FeatureClass&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Traceback (most recent call last):
  File "C:\Users\zach.edwards\OneDrive - Western Data Systems\Documents\AllTerraCentral\Python\ListFCFeaturesRecursivelyCountNameReportDeletezero_PRO.py", line 22, in &amp;lt;module&amp;gt;
    lyr_view = arcpy.MakeFeatureLayer_management (shapefile, f'{layerName}_lyr')
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 10316, in MakeFeatureLayer
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 10313, in MakeFeatureLayer
    retval = convertArcObjectToPythonObject(gp.MakeFeatureLayer_management(*gp_fixargs((in_features, out_layer, where_clause, workspace, field_info), True)))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;
    return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: &lt;/SPAN&gt;ERROR 999999:&lt;SPAN class=""&gt; Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Failed to execute (MakeFeatureLayer).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 May 2023 17:07:26 GMT</pubDate>
    <dc:creator>Zedwards_SIPI</dc:creator>
    <dc:date>2023-05-30T17:07:26Z</dc:date>
    <item>
      <title>Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293905#M67734</link>
      <description>&lt;P&gt;Hello Folks,&lt;/P&gt;&lt;P&gt;I am not a programmer but am getting more and more familiar with ArcPy with ArcGIS Pro these days. I have purchased a digital book that has proven quite useful too. That being said, I am receiving the following error when executing a toolbox script (.py):&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, it works fine when run from ArcMap or ArcCatalog and even does what it's supposed to do in Pro but throws the error below .I have also updated my project packages but do get errors when trying to do certain updates or install Spyder from there. Any ideas are much appreciated.&lt;/P&gt;&lt;PRE&gt;Start Time: Monday, May 29, 2023 3:30:17 PM&lt;/PRE&gt;&lt;PRE&gt;NM_wind&lt;/PRE&gt;&lt;PRE&gt;ShapeFile&lt;/PRE&gt;&lt;PRE&gt;1328&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Nothing to Delete&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;Test&lt;/PRE&gt;&lt;PRE&gt;FeatureClass&lt;/PRE&gt;&lt;PRE&gt;0&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;EMPTY VECTOR DATASET DELETED&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Traceback (most recent call last):
  File "C:\Users\zach.edwards\OneDrive - Western Data Systems\Documents\AllTerraCentral\Python\ListFCFeaturesRecursivelyCountNameReportDeletezero_PRO.py", line 33, in &amp;lt;module&amp;gt;
    if int(arcpy.GetCount_management(layerName).getOutput(0)) == 0:
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 23607, in GetCount
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 23604, in GetCount
    retval = convertArcObjectToPythonObject(gp.GetCount_management(*gp_fixargs((in_rows,), True)))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;
    return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;ERROR 000840:&lt;SPAN class=""&gt; The value is not a Table View.&lt;/SPAN&gt;ERROR 000840:&lt;SPAN class=""&gt; The value is not a Raster Layer.
Failed to execute (GetCount)&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The actual .py is pasted here below...&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;DIV&gt;import arcpy&lt;/DIV&gt;&lt;DIV&gt;import os&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;workspace = arcpy.GetParameterAsText(0)&lt;/DIV&gt;&lt;DIV&gt;outFile = open(r"C:\temp\VectorDataList.txt", "a")&lt;/DIV&gt;&lt;DIV&gt;shapefiles = []&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;walk = arcpy.da.Walk(workspace, topdown=True, datatype="FeatureClass")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;for dirpath, dirnames, filenames in walk:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for filename in filenames:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;shapefiles.append(os.path.join(dirpath, filename))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;for shapefile in shapefiles:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;layerName = arcpy.Describe(shapefile).baseName&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;layerPath = arcpy.Describe(shapefile).path&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;layerDType = arcpy.Describe(shapefile).dataType&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.AddMessage(layerName)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.AddMessage(layerDType)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management (shapefile, layerName)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.AddMessage(arcpy.GetCount_management(layerName).getOutput(0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if int(arcpy.GetCount_management(layerName).getOutput(0)) == 0:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.Delete_management(shapefile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.AddWarning("EMPTY VECTOR DATASET DELETED")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.AddWarning("Nothing to Delete")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write("\n" "Filename: ")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write(layerName)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write("\n""Path: ")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write(dirpath)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write("\n" "DataType: ")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write(layerDType)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write("\n" "Feature Count: ")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if int(arcpy.GetCount_management(layerName).getOutput(0)) == 0:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write(arcpy.GetCount_management(layerName).getOutput(0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write("\n" "EMPTY VECTOR DATASET DELETED")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write(arcpy.GetCount_management(layerName).getOutput(0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outFile.write("\n")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;outFile.close()&lt;/DIV&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 21:40:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293905#M67734</guid>
      <dc:creator>Zedwards_SIPI</dc:creator>
      <dc:date>2023-05-29T21:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293906#M67735</link>
      <description>&lt;P&gt;One more thing, I did run the following tool to see if there were any issues and none were reported both on the toolbox and .py file.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 21:42:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293906#M67735</guid>
      <dc:creator>Zedwards_SIPI</dc:creator>
      <dc:date>2023-05-29T21:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293919#M67736</link>
      <description>&lt;P&gt;formatting will provide proper indentation and line numbers to make it easier to read your code&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 22:52:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293919#M67736</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-05-29T22:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293920#M67737</link>
      <description>&lt;LI-CODE lang="python"&gt;import arcpy
import os

workspace = arcpy.GetParameterAsText(0)
outFile = open(r"C:\temp\VectorDataList.txt", "a")
shapefiles = []

walk = arcpy.da.Walk(workspace, topdown=True, datatype="FeatureClass")

for dirpath, dirnames, filenames in walk:
	for filename in filenames:
		shapefiles.append(os.path.join(dirpath, filename))
for shapefile in shapefiles:
	layerName = arcpy.Describe(shapefile).baseName
	layerPath = arcpy.Describe(shapefile).path
	layerDType = arcpy.Describe(shapefile).dataType
	arcpy.AddMessage(layerName)
	arcpy.AddMessage(layerDType)
	arcpy.MakeFeatureLayer_management (shapefile, layerName)
	arcpy.AddMessage(arcpy.management.GetCount(layerName).getOutput(0))
	if int(arcpy.management.GetCount(layerName).getOutput(0)) == 0:
		arcpy.management.Delete(shapefile)
		arcpy.AddWarning("EMPTY VECTOR DATASET DELETED")
	else:
		arcpy.AddWarning("Nothing to Delete")
	outFile.write("\n" "Filename: ")
	outFile.write(layerName)
	outFile.write("\n""Path: ")
	outFile.write(dirpath)
	outFile.write("\n" "DataType: ")
	outFile.write(layerDType)
	outFile.write("\n" "Feature Count: ")
	if int(arcpy.management.GetCount(layerName).getOutput(0)) == 0:
		outFile.write(arcpy.management.GetCount(layerName).getOutput(0))
		outFile.write("\n" "EMPTY VECTOR DATASET DELETED")
	else:
		outFile.write(arcpy.management.GetCount(layerName).getOutput(0))
	outFile.write("\n")
outFile.close()&lt;/LI-CODE&gt;&lt;P&gt;Thanks Dan. New to this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 22:57:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1293920#M67737</guid>
      <dc:creator>Zedwards_SIPI</dc:creator>
      <dc:date>2023-05-29T22:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294104#M67739</link>
      <description>&lt;P&gt;line 33-35 code seems like it's redundant since it is done in line 21-23. Put line 34 in the 21 if and line 37 in the else on 24.&lt;/P&gt;&lt;P&gt;You can also just get the describe once:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;desc = arcpy.Describe(shapefile)
layerName = desc.baseName
layerPath = desc.path
layerDType = desc.dataType&lt;/LI-CODE&gt;&lt;P&gt;The memory workspace is a bit of mystery with its functionality and I am wondering if the layer you create is also removed when you delete it in 22 when the code reaches 33, causing that error.&amp;nbsp; I'd avoid using the same name for the layer in memory as the layer referenced in the loop, even though the shapefile is a path. layerName starts as a string variable, but then it becomes a reference to a layer view. Outside of the esri environment, this may be causing problems.&amp;nbsp; Try to be more explicit in the variables like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for shapefile in shapefiles:
    desc = arcpy.Describe(shapefile)
    layerName = desc.baseName
    layerPath = desc.path
    layerDType = desc.dataType
    arcpy.AddMessage(layerName)
    arcpy.AddMessage(layerDType)
    lyr_view = arcpy.MakeFeatureLayer_management (shapefile, f'{layerName}_lyr')
    arcpy.AddMessage(arcpy.management.GetCount(lyr_view).getOutput(0))
    ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 15:47:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294104#M67739</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-05-30T15:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294114#M67740</link>
      <description>&lt;P&gt;Thansk Jeff. All working now. The difference is good code etiquette versus poor. I cleaned it up and it's working well. I just need to reorganize.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 16:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294114#M67740</guid>
      <dc:creator>Zedwards_SIPI</dc:creator>
      <dc:date>2023-05-30T16:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294144#M67742</link>
      <description>&lt;P&gt;What's odd is that everything works error free with the code below but when I have many subfolders (drill deeper into file explorer), I get the following messages/errors:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os

workspace = arcpy.GetParameterAsText(0)
outFile = open(r"C:\temp\VectorDataList.txt", "a")
shapefiles = []

walk = arcpy.da.Walk(workspace, topdown=True, datatype="FeatureClass")

for dirpath, dirnames, filenames in walk:
    for filename in filenames:
        shapefiles.append(os.path.join(dirpath, filename))
for shapefile in shapefiles:
        desc = arcpy.Describe(shapefile)
        layerName = desc.baseName
        layerPath = desc.path
        layerDType = desc.dataType
        arcpy.AddMessage(layerName)
        arcpy.AddMessage(layerDType)
#       arcpy.MakeFeatureLayer_management (shapefile, layerName)
#       arcpy.AddMessage(arcpy.management.GetCount(layerName).getOutput(0))
        lyr_view = arcpy.MakeFeatureLayer_management (shapefile, f'{layerName}_lyr')
        arcpy.AddMessage(arcpy.management.GetCount(lyr_view).getOutput(0))
        if int(arcpy.management.GetCount(lyr_view).getOutput(0)) == 0:
            arcpy.AddMessage("EMPTY VECTOR DATASET DELETED")
            outFile.write("\n" "Filename: ")
            outFile.write(layerName)
            outFile.write("\n""Path: ")
            outFile.write(dirpath)
            outFile.write("\n" "DataType: ")
            outFile.write(layerDType)
            outFile.write("\n" "Feature Count: ")
            outFile.write(arcpy.management.GetCount(lyr_view).getOutput(0))
            outFile.write("\n" "EMPTY VECTOR DATASET DELETED")
            arcpy.management.Delete(shapefile)
            outFile.write("\n")
        else:
            arcpy.AddMessage("Nothing to Delete")
            outFile.write("\n" "Filename: ")
            outFile.write(layerName)
            outFile.write("\n""Path: ")
            outFile.write(dirpath)
            outFile.write("\n" "DataType: ")
            outFile.write(layerDType)
            outFile.write("\n" "Feature Count: ")
            outFile.write(arcpy.management.GetCount(lyr_view).getOutput(0))
            outFile.write("\n")
outFile.close()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Start Time: Tuesday, May 30, 2023 11:03:15 AM&lt;/PRE&gt;&lt;PRE&gt;Polylines&lt;/PRE&gt;&lt;PRE&gt;FeatureClass&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Traceback (most recent call last):
  File "C:\Users\zach.edwards\OneDrive - Western Data Systems\Documents\AllTerraCentral\Python\ListFCFeaturesRecursivelyCountNameReportDeletezero_PRO.py", line 22, in &amp;lt;module&amp;gt;
    lyr_view = arcpy.MakeFeatureLayer_management (shapefile, f'{layerName}_lyr')
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 10316, in MakeFeatureLayer
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 10313, in MakeFeatureLayer
    retval = convertArcObjectToPythonObject(gp.MakeFeatureLayer_management(*gp_fixargs((in_features, out_layer, where_clause, workspace, field_info), True)))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;
    return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: &lt;/SPAN&gt;ERROR 999999:&lt;SPAN class=""&gt; Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Failed to execute (MakeFeatureLayer).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 17:07:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294144#M67742</guid>
      <dc:creator>Zedwards_SIPI</dc:creator>
      <dc:date>2023-05-30T17:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294286#M67752</link>
      <description>&lt;P&gt;paths... sometimes spaces, punctuation and OneDrive cause issues. Avoid their construction and use to avoid the "unexpected " error..&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 21:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294286#M67752</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-05-30T21:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294465#M67756</link>
      <description>&lt;P&gt;Adding to Dan's advice, print the path out of that file that it is stopping on.&lt;/P&gt;&lt;P&gt;I tried your code on a folder and the arcpy.da.Walk did not honor the FeatureClass datatype and included RasterBand files too, which caused it to fail. You can add some logic to your code to skip these unaccounted file types that sneak through so you can check them out manually but still work through the Featureclasses and shapefiles:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os

workspace = arcpy.GetParameterAsText(0)
if workspace is None or workspace == '':
    workspace = r'default path to parent folder for running in IDE'


def outfile_writer(layerName, layerPath, lyr_view, msg):
    '''
    helper function for writing the output to file
    '''
    outFile.write(f"\nFilename: {layerName} "
                  f"\nPath: {layerPath} "
                  f"\nFeature Count: {arcpy.management.GetCount(lyr_view).getOutput(0)}"
                  f"\n{msg}\n")

shapefiles = []

for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, topdown=True, datatype="FeatureClass"):
    for filename in filenames:
        shapefiles.append(os.path.join(dirpath, filename))

with open(r"path to \VectorDataList.txt", "a") as outFile:
    for shapefile in shapefiles:
        desc = arcpy.Describe(shapefile)
        layerName = desc.baseName
        layerPath = desc.path
        layerDType = desc.dataType

        arcpy.AddMessage(layerName)
        arcpy.AddMessage(layerDType)
        arcpy.AddMessage(layerPath)

        if layerDType in ['FeatureClass', 'ShapeFile']:
            lyr_view = arcpy.MakeFeatureLayer_management (shapefile, f'{layerName}_lyr')
            try:
                arcpy.AddMessage(arcpy.management.GetCount(lyr_view).getOutput(0))
                if int(arcpy.management.GetCount(lyr_view).getOutput(0)) == 0:
                    arcpy.AddMessage("EMPTY VECTOR DATASET DELETED")
                    outfile_writer(layerName, layerPath, lyr_view, 'EMPTY VECTOR DATASET DELETED')
                    arcpy.management.Delete(shapefile)
                else:
                    arcpy.AddMessage("Nothing to Delete")
                    outfile_writer(layerName, layerPath, lyr_view, 'DATASET NOT DELETED')

            except Exception as ex:
                arcpy.AddMessage(f"Could not open {layerName} at {layerPath}")
                outFile.write(f"\nCOULD NOT DELETE! {layerName} at {layerDType}")

        else:
            outFile.write(f"\nSKIPPIED! arcpy.da.Walk datatype filter failed: {layerName} is {layerDType}\n")
            arcpy.AddMessage(f"\nSKIPPIED! arcpy.da.Walk datatype filter failed: {layerName} is {layerDType}")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 13:20:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294465#M67756</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-05-31T13:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294529#M67763</link>
      <description>&lt;P&gt;Unfortunately, I am getting the same errors with this code. I will test a few things and report back. What's odd is that the path that I am testing is my desktop which is simply:&amp;nbsp;C:\Users\zach.edwards\Desktop&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 15:30:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294529#M67763</guid>
      <dc:creator>Zedwards_SIPI</dc:creator>
      <dc:date>2023-05-31T15:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3 Script Not Executing without Error in ArcGIS Pro 3.1.2 but runs Error Free in ArcMap 10.8.1</title>
      <link>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294940#M67775</link>
      <description>&lt;P&gt;Is the file corrupt? If its a shapefile, does it have all the necessary files (shp, dbf, shx) with it? Try getting the count of data before making it a feature layer to see if it's the method or the file.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 13:27:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-3-script-not-executing-without-error-in/m-p/1294940#M67775</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-06-01T13:27:20Z</dc:date>
    </item>
  </channel>
</rss>

