<?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 Error when working with network drives in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035704#M60344</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The last line of my script produces an error in my script when a network filesystem is provided for "ow_space," but the script works fine when a local filesystem is provided instead.&amp;nbsp; Note that "ow_space" retrieves parameter 0, which is set to "workspace" and not "folder" since I want this parameter to also accept a file geodatabase (which is working in the script).&amp;nbsp; The error message is nonspecific and unhelpful.&amp;nbsp; How can I get&amp;nbsp;arcpy.CreateFeatureclass_management to work regardless of whether ow_space is a network location or a local directory?&amp;nbsp; e.g.&amp;nbsp;\\JLLORENS\Share\GIS&lt;/P&gt;&lt;P&gt;Below is the code in question:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;from arcpy.sa import *&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;ow_space = arcpy.GetParameterAsText(0)&lt;BR /&gt;in_WSheds = arcpy.GetParameterAsText(1)&lt;BR /&gt;file_name = arcpy.GetParameterAsText(2)&lt;BR /&gt;vector_extension_output = '.shp'&lt;/P&gt;&lt;P&gt;arcpy.CreateFeatureclass_management(ow_space, ('%s_Longest_Flowpaths_Vector%s' % (file_name, vector_extension_output)), 'POLYLINE', spatial_reference = (arcpy.Describe(in_WSheds).spatialReference))&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Mar 2021 21:39:20 GMT</pubDate>
    <dc:creator>jllorens</dc:creator>
    <dc:date>2021-03-11T21:39:20Z</dc:date>
    <item>
      <title>Error when working with network drives</title>
      <link>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035704#M60344</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The last line of my script produces an error in my script when a network filesystem is provided for "ow_space," but the script works fine when a local filesystem is provided instead.&amp;nbsp; Note that "ow_space" retrieves parameter 0, which is set to "workspace" and not "folder" since I want this parameter to also accept a file geodatabase (which is working in the script).&amp;nbsp; The error message is nonspecific and unhelpful.&amp;nbsp; How can I get&amp;nbsp;arcpy.CreateFeatureclass_management to work regardless of whether ow_space is a network location or a local directory?&amp;nbsp; e.g.&amp;nbsp;\\JLLORENS\Share\GIS&lt;/P&gt;&lt;P&gt;Below is the code in question:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;from arcpy.sa import *&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;ow_space = arcpy.GetParameterAsText(0)&lt;BR /&gt;in_WSheds = arcpy.GetParameterAsText(1)&lt;BR /&gt;file_name = arcpy.GetParameterAsText(2)&lt;BR /&gt;vector_extension_output = '.shp'&lt;/P&gt;&lt;P&gt;arcpy.CreateFeatureclass_management(ow_space, ('%s_Longest_Flowpaths_Vector%s' % (file_name, vector_extension_output)), 'POLYLINE', spatial_reference = (arcpy.Describe(in_WSheds).spatialReference))&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 21:39:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035704#M60344</guid>
      <dc:creator>jllorens</dc:creator>
      <dc:date>2021-03-11T21:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error when working with network drives</title>
      <link>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035760#M60345</link>
      <description>&lt;P&gt;Is there a group policy governing/ access restrictions on your network that may be causing an issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 23:53:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035760#M60345</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-03-11T23:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error when working with network drives</title>
      <link>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035819#M60349</link>
      <description>&lt;P&gt;No, I have full write access.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that using the following fixed my issue.&amp;nbsp; I cannot figure out why, since I would expect GetParameterAsText() to return a string anyways, but apparently using str() fixes the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replacing:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ow_space = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ow_space = str(arcpy.GetParameterAsText(0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;was the fix.&amp;nbsp; If anyone can elaborate why this works, that would be awesome.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 04:25:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035819#M60349</guid>
      <dc:creator>jllorens</dc:creator>
      <dc:date>2021-03-12T04:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error when working with network drives</title>
      <link>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035820#M60350</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/462641"&gt;@jllorens&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I agree with&amp;nbsp;@Anonymous User, that is a very likely cause.&lt;/P&gt;&lt;P&gt;You may want to try converting it to "real Path" as well.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy.CreateFeatureclass_management(&lt;STRONG&gt;r'{}'.format(ow_space)&lt;/STRONG&gt;, ('%s_Long......&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;That may help since "&lt;SPAN&gt;GetParameterAsText" tends to be very literal, which would mean that the network&amp;nbsp;path would not be complete&amp;nbsp;as far as Python is&amp;nbsp;&lt;/SPAN&gt;concerned.&amp;nbsp; \ is an "Escape" character, so to do the start of a network path, usually "\\" you actually need to do "\\\\".&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 04:26:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-when-working-with-network-drives/m-p/1035820#M60350</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-03-12T04:26:57Z</dc:date>
    </item>
  </channel>
</rss>

