<?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: cannot access geodatabase using windows command line in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683989#M52954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Setting a workspace is just a variable, it does not test if the workspace exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try a test first to debug your path. I got the same null response when using XP because of course the path is different.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "c:/users/kimo/documents/arcgis/default.gdb"
&amp;gt;&amp;gt;&amp;gt; arcpy.ListFeatureClasses()
[]
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = r"C:\Documents and Settings\kimo\My Documents\ArcGIS\Default.gdb"
&amp;gt;&amp;gt;&amp;gt; arcpy.ListFeatureClasses()
[u'sea1_Buffer', u'amenity2_EliminatePolygonPar']
&amp;gt;&amp;gt;&amp;gt; ws = r"C:\Documents and Settings\kimo\My Documents\ArcGIS\Default.gdb"
&amp;gt;&amp;gt;&amp;gt; if arcpy.Exists(ws):
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ListFeatureClasses()
... else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Workspace not found"
...
[u'sea1_Buffer', u'amenity2_EliminatePolygonPar']&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The path does not have to be unicode u"path" but you do have to be careful with path separators.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:46:02 GMT</pubDate>
    <dc:creator>KimOllivier</dc:creator>
    <dc:date>2021-12-12T04:46:02Z</dc:date>
    <item>
      <title>cannot access geodatabase using windows command line</title>
      <link>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683988#M52953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;While i can set the workspace and get all the feature classes of geodatabase using Arcmap python window, i can set the workspace using windows commmand line window but i can't get the feature classes, to check if i've made a connection with the geodatabase.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the script above returns in Arcmap python windows array containing feature classes , but in commande line window it returns an empty array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;import arcpy 
&amp;gt;&amp;gt;arcpy.env.workspace = u'C:\\Users\\hp\\Documents\\ArcGIS\\Default.gdb'
&amp;gt;&amp;gt;arcpy.ListFeatureClasses()
&amp;gt;&amp;gt;[]&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i've checked global variables in windows 7:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PYTHONPATH = C:\Program Files (x86)\ArcGIS\Desktop10.0\bin;C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy;C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Scripts&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the concerned part of PATH = C:\Python26\ArcGIS10.0;C:\Python26\ArcGIS10.0\Scripts;C:\Program Files (x86)\ArcGIS\ArcSDE\pgexe\bin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Available for more details&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;please help i'm stuck in this problem since a week &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;geogeek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 07:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683988#M52953</guid>
      <dc:creator>geogeekgeogeek</dc:creator>
      <dc:date>2012-06-29T07:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: cannot access geodatabase using windows command line</title>
      <link>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683989#M52954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Setting a workspace is just a variable, it does not test if the workspace exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try a test first to debug your path. I got the same null response when using XP because of course the path is different.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "c:/users/kimo/documents/arcgis/default.gdb"
&amp;gt;&amp;gt;&amp;gt; arcpy.ListFeatureClasses()
[]
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = r"C:\Documents and Settings\kimo\My Documents\ArcGIS\Default.gdb"
&amp;gt;&amp;gt;&amp;gt; arcpy.ListFeatureClasses()
[u'sea1_Buffer', u'amenity2_EliminatePolygonPar']
&amp;gt;&amp;gt;&amp;gt; ws = r"C:\Documents and Settings\kimo\My Documents\ArcGIS\Default.gdb"
&amp;gt;&amp;gt;&amp;gt; if arcpy.Exists(ws):
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ListFeatureClasses()
... else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Workspace not found"
...
[u'sea1_Buffer', u'amenity2_EliminatePolygonPar']&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The path does not have to be unicode u"path" but you do have to be careful with path separators.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683989#M52954</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2021-12-12T04:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: cannot access geodatabase using windows command line</title>
      <link>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683990#M52955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Mr Kim,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i've tried to check if the workspace exists like you have mentioned , i debug the code in Arcmap python window, when i'm sure that the code works , then i try it in windows console , but it gimme always an empty array :(.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 21:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683990#M52955</guid>
      <dc:creator>geogeekgeogeek</dc:creator>
      <dc:date>2012-06-29T21:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: cannot access geodatabase using windows command line</title>
      <link>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683991#M52956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Debug it in the console as well. Use Pythonwin because it is easier to check the syntax is correct and debug. Check if it exists again there. If the path contains backslashes then they have to be handled as escape characters in a string.&amp;nbsp; Use forward slashes instead, or a raw tag r"C:\path" or two backslashes "c:\\path".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Put the script in a python file and execute that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You must have a really simple error that is so obvious that you cannot see it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe the path is to an empty geodatabase because you are looking at different users.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Browse to it using ArcCatalog and look there to see if there is anything there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The path on my machine to the default.gdb is&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
r"C:\Users\kimo\My Documents\ArcGIS\Default.gdb"
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683991#M52956</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2021-12-12T04:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: cannot access geodatabase using windows command line</title>
      <link>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683992#M52957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Mr Kim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i've applied your recommendations but without a result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 14:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683992#M52957</guid>
      <dc:creator>geogeekgeogeek</dc:creator>
      <dc:date>2012-07-10T14:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: cannot access geodatabase using windows command line</title>
      <link>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683993#M52958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;trying changing it to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'C:/Users/kimo/Documents/ArcGIS/Default.gdb'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 21:42:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-access-geodatabase-using-windows-command/m-p/683993#M52958</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2015-07-30T21:42:23Z</dc:date>
    </item>
  </channel>
</rss>

