I have the following code to convert KML to Shapefiels but i am getting error on line 26 i am not sure why?
line 26, in <module>
wks.remove(MasterGDBLocation)
ValueError: list.remove(x): x not in list
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> os
<SPAN class="comment token"># Set workspace (where all the KMLs are)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace<SPAN class="operator token">=</SPAN><SPAN class="string token">"D:\GIS Folder\IDTrialsRoads"</SPAN>
<SPAN class="comment token"># Set local variables and location for the consolidated file geodatabase</SPAN>
outLocation <SPAN class="operator token">=</SPAN> <SPAN class="string token">"D:\GIS Folder\IDTrialsRoads"</SPAN>
MasterGDB <SPAN class="operator token">=</SPAN> <SPAN class="string token">'TrailsRoads.mdb'</SPAN>
MasterGDBLocation <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>outLocation<SPAN class="punctuation token">,</SPAN> MasterGDB<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Create the master FileGeodatabase</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CreateFileGDB_management<SPAN class="punctuation token">(</SPAN>outLocation<SPAN class="punctuation token">,</SPAN> MasterGDB<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Convert all KMZ and KML files found in the current workspace</SPAN>
<SPAN class="keyword token">for</SPAN> kmz <SPAN class="keyword token">in</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFiles<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'*.KM*'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"CONVERTING: "</SPAN> <SPAN class="operator token">+</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace<SPAN class="punctuation token">,</SPAN>kmz<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>KMLToLayer_conversion<SPAN class="punctuation token">(</SPAN>kmz<SPAN class="punctuation token">,</SPAN> outLocation<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Change the workspace to fGDB location</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> outLocation
<SPAN class="comment token"># Loop through all the FileGeodatabases within the workspace</SPAN>
wks <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListWorkspaces<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'*'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'FileGDB'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Skip the Master GDB</SPAN>
wks<SPAN class="punctuation token">.</SPAN>remove<SPAN class="punctuation token">(</SPAN>MasterGDBLocation<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> fgdb <SPAN class="keyword token">in</SPAN> wks<SPAN class="punctuation token">:</SPAN>
<SPAN class="comment token"># Change the workspace to the current FileGeodatabase</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> fgdb
<SPAN class="comment token"># For every Featureclass inside, copy it to the Master and use the name from the original fGDB </SPAN>
featureClasses <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFeatureClasses<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'*'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'Placemarks'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> fc <SPAN class="keyword token">in</SPAN> featureClasses<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"COPYING: "</SPAN> <SPAN class="operator token">+</SPAN> fc <SPAN class="operator token">+</SPAN> <SPAN class="string token">" FROM: "</SPAN> <SPAN class="operator token">+</SPAN> fgdb
fcCopy <SPAN class="operator token">=</SPAN> fgdb <SPAN class="operator token">+</SPAN> os<SPAN class="punctuation token">.</SPAN>sep <SPAN class="operator token">+</SPAN> <SPAN class="string token">'Placemarks'</SPAN> <SPAN class="operator token">+</SPAN> os<SPAN class="punctuation token">.</SPAN>sep <SPAN class="operator token">+</SPAN> fc
arcpy<SPAN class="punctuation token">.</SPAN>FeatureClassToFeatureClass_conversion<SPAN class="punctuation token">(</SPAN>fcCopy<SPAN class="punctuation token">,</SPAN> MasterGDBLocation<SPAN class="punctuation token">,</SPAN> fgdb<SPAN class="punctuation token">[</SPAN>fgdb<SPAN class="punctuation token">.</SPAN>rfind<SPAN class="punctuation token">(</SPAN>os<SPAN class="punctuation token">.</SPAN>sep<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">"_"</SPAN> <SPAN class="operator token">+</SPAN> fc<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>