<?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: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why? in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838894#M467</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have already included import arcpy.&lt;/P&gt;&lt;P&gt;Its not working in when i run script from command prompt.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Dec 2014 12:24:27 GMT</pubDate>
    <dc:creator>GauriDeshmukh</dc:creator>
    <dc:date>2014-12-22T12:24:27Z</dc:date>
    <item>
      <title>arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838892#M465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp; My python script runs well and returns all tables from mdb with arcpy.ListTables() command when i run a script in IDLE(default IDE) or python window from arcmap. But when I try to run the same script from cmd arcpy.ListTables() returns blank list []. What could be the problem?And what is the solution? As I am calling this script in my C# desktop application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import xlrd
import datetime
import os
import sys
#sys.path.append("C:\Program Files\ArcGIS\Desktop10.0\arcpy")
import arcpy


#arcpy.ResetEnvironments()
&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;arcpy.&lt;/SPAN&gt;env.workspace = r"D:/Final/gdb_workspace/New Personal Geodatabase.mdb"
#Get and print a list of tables
tables = arcpy.ListTables()
print tables
for table in tables:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print table&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my simple code to list tables.I want to insert data from excel file to a particular table from this personal gdb.&lt;/P&gt;&lt;P&gt;When I run this script using cmd(out of arcgis environment) its not returning tables.&lt;/P&gt;&lt;P&gt;Is this possible to achieve and how? Or do I need to use any geoprocessing service?Any other way to achieve this?&lt;/P&gt;&lt;P&gt;I am able to insert data into mdb if i run the script in IDLE or python window from arcmap.&lt;/P&gt;&lt;P&gt;Please tell me the right way to do this task.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:13:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838892#M465</guid>
      <dc:creator>GauriDeshmukh</dc:creator>
      <dc:date>2021-12-12T10:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838893#M466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy is know to exist from python within arcmap, but not outside of it.&amp;nbsp; it needs to be imported in most languages (ie python running outside of arcmap, or separately from it)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 11:19:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838893#M466</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-12-22T11:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838894#M467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have already included import arcpy.&lt;/P&gt;&lt;P&gt;Its not working in when i run script from command prompt.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 12:24:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838894#M467</guid>
      <dc:creator>GauriDeshmukh</dc:creator>
      <dc:date>2014-12-22T12:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838895#M468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you setting the workspace environment?&amp;nbsp; Can you post the functional part of the code that isn't working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have more than 1 Python install on the machine?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 14:54:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838895#M468</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-12-22T14:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838896#M469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gauri:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you running this script in a 64-bit environment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 15:04:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838896#M469</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-12-22T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838897#M470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have posted the functional part which is not working. I have only 1 python installed on my machine. python 2.6 for arcgis 10.0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2014 05:33:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838897#M470</guid>
      <dc:creator>GauriDeshmukh</dc:creator>
      <dc:date>2014-12-23T05:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838898#M471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having 32 bit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2014 05:35:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838898#M471</guid>
      <dc:creator>GauriDeshmukh</dc:creator>
      <dc:date>2014-12-23T05:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838899#M472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;probably has no effect but worth checking&lt;/P&gt;&lt;P&gt;r&lt;SPAN class="string"&gt;"D:/Final/gdb_workspace/New Personal Geodatabase.mdb"&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; raw notation is used when paths have backslashes and not foreslashes&lt;/P&gt;&lt;P&gt;table@@ I am not farmiliar with @@ is that a substitute for printing its name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2014 06:47:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838899#M472</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-12-23T06:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838900#M473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry its variable table only.&lt;/P&gt;&lt;P&gt;I tried by all way.. i.e. with r without r. I tried giving path in different way.but not working in cmd. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2014 09:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838900#M473</guid>
      <dc:creator>GauriDeshmukh</dc:creator>
      <dc:date>2014-12-23T09:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838901#M474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure the script is running at all when called from the command line by your other program?&amp;nbsp; If you try printing 'hello world' from the script, does that even work from the command line?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 03:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838901#M474</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-01-06T03:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838902#M475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might not fix your problem since you are on version 10, but this was my resolution to the same issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have ArcGIS 10.2.2 and Python 2.7, and in &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;C:\Python27\&lt;/EM&gt;&lt;/SPAN&gt; I have &lt;STRONG&gt;ArcGIS10.2&lt;/STRONG&gt; (32bit) and &lt;STRONG&gt;ArcGISx6410.2&lt;/STRONG&gt; (64bit). I believe they are both included in the standard install. I cannot say for 32bit machines, but the default idle in the start menu is set to &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;C:\Python27\ArcGISx6410.2&lt;/EM&gt;&lt;/SPAN&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran the code in 32bit cmd (&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;C:\Python27\ArcGIS10.2\python.exe)&lt;/EM&gt;&lt;/SPAN&gt; and arcpy.ListTables() worked, but didn't in 32bit Idle (&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;C:\Python27\ArcGIS10.2\Lib\idlelib\idle.pyw&lt;/EM&gt;&lt;/SPAN&gt; ). I had a look at the path browser in the 32bit Idle and it's referencing a lot of files from the ArcGISx6410.2 folder (&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;C:\Python27\ArcGISx6410.2\)&lt;/EM&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to try re-running the code directly from 32bit cmd (&lt;EM&gt;C:\Python27\ArcGIS10.2\python.exe)&lt;/EM&gt; and see how you go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working in Visual Studio, so once I changed my default environment from &lt;STRONG&gt;ArcGISx6410.2 &lt;/STRONG&gt;to&lt;STRONG&gt; &lt;STRONG&gt;ArcGIS10.2&lt;/STRONG&gt;&lt;/STRONG&gt;, arcpy.ListTables() worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, this might not fix your issue, and this post is a few months old, but might give you an idea that might. Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*note replace 10.2 references for 10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 07:05:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838902#M475</guid>
      <dc:creator>RichelleSpry</dc:creator>
      <dc:date>2015-03-13T07:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838903#M476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the C:\Python27\ArcGISx6410.2 directory on your machine, then you installed 64-bit Background Geoprocessing (&lt;EM&gt;not part of the standard installation&lt;/EM&gt;) or ArcGIS for Server.&amp;nbsp; Assuming the latter isn't the case, the former is what put the extra Python interpreter installation on your machine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regard to the OP's situation, 64-bit Background Geooprocessing wasn't introduced until ArcGIS 10.1 SP1.&amp;nbsp; That said, the information provided is useful for others that install 64-bit Background Geoprocessing and get confused over which Python interpreter they are using when.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 14:12:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838903#M476</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-03-13T14:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.ListTables() doesnt work in cmd but works in IDLE or arcmap python window,why?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838904#M477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To be honest I couldn't remember if it was apart of the standard install or the &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;64-bit Background Geoprocessing. I did check before my post with a team member who I thought didn't have it installed, but this proves she did. Thanks for clarifying this Joshua.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 21:32:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/arcpy-listtables-doesnt-work-in-cmd-but-works-in/m-p/838904#M477</guid>
      <dc:creator>RichelleSpry</dc:creator>
      <dc:date>2015-03-13T21:32:56Z</dc:date>
    </item>
  </channel>
</rss>

