<?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: Simple Python Script Runs on Desktop but Not Server in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169830#M13081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&amp;nbsp; The path to the SDE connection file needs to be accessible by the process executing the script.&amp;nbsp; If the SDE connection file exists only on your machine, and a process on the server has no way to access that SDE connection file, then it will fail.&amp;nbsp; In the code 2 years ago by the OP, the SDE connection file appears to be stored on a file share that was likely accessible by both the desktop and server.&amp;nbsp; In your case, the SDE connection file is stored on the desktop and is inaccessible to the server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2017 15:00:49 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2017-01-20T15:00:49Z</dc:date>
    <item>
      <title>Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169823#M13074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a python script that simply lists out all of the feature classes in our SDE database, which I'm running directly through the Python Shell. The script will eventually export feature classes from our SDE database to a file geodatabase via Windows Task Scheduler, but I was having trouble getting that to work, so I simplified it to do some testing. The script is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14066638304491654" jivemacro_uid="_14066638304491654"&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;from arcpy import env&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;env.workspace = "//mplgis-fs.moc.com/gis_data/connections/ConnectiontoMPLGIS-TEST.sde"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;print arcpy.ListFeatureClasses()&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On my desktop PC (Win 7 64-bit, ArcGIS for Desktop 10.2.2), the script executes correctly and returns the list of features:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="working.jpg" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/2718_working.jpg" style="width: 620px; height: 316px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I run it on the server (Windows Server 2008R2, ArcGIS for Server 10.2.2), it does not return any feature classes, and I'm stumped as to why that is:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="notworking.jpg" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/2719_notworking.jpg" style="width: 620px; height: 308px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts on what might be causing it? In the screenshots I show that the server is using the ArcServer license, while the desktop is using the ArcInfo, but I'm not sure if that should make a difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 19:59:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169823#M13074</guid>
      <dc:creator>DanielHorn</dc:creator>
      <dc:date>2014-07-29T19:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169824#M13075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did some further investigation. I was able to use the ListFeatureClasses() method on a file geodatabase succesfully from the server, so it appears like it may be an issue when accessing the SDE through the connection file. The connection file is setup as a database connection with databse authentication, and I don't have any issues accessing the feature classes through ArcCatalog on my desktop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 16:58:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169824#M13075</guid>
      <dc:creator>DanielHorn</dc:creator>
      <dc:date>2014-07-30T16:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169825#M13076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Have you installed the SQL Server native client on your server machine? This might be the reason you are not able to connect to the database. Try installing the native client and then rerunning the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 18:39:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169825#M13076</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2014-07-30T18:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169826#M13077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I finally figured out the issue (after far too long, I might add!). SQL Server Native Client was installed, but the connection file was setup using an alias to the database server, not the server name itself. The database aliases are stored in the registry on each machine and they had not been pushed to any of the new GIS servers we had provisioned. I got the registry file that I needed to create the proper entries and it works perfectly now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 14:53:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169826#M13077</guid>
      <dc:creator>DanielHorn</dc:creator>
      <dc:date>2014-07-31T14:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169827#M13078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also am having this issue. I have a simple script that runs fine on desktop but not Server. I'm getting the error "00732 connection to "Database Connections\\Connection to &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GFCARCSERVER.sde\\gfcgis.DBO.FIREDATAFINAL_OFFICIAL"database does not exist or is not supported."&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where do I find the database Aliases in the Registry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 22:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169827#M13078</guid>
      <dc:creator>MichaelTorbett1</dc:creator>
      <dc:date>2017-01-19T22:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169828#M13079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your issue may not be related to database aliases.&amp;nbsp; Seeing the error message, it appears you are using a relative path (from Database Connections folder) instead of a fully qualified path.&amp;nbsp; Does the server have a copy of the "Connection to GFCARCSERVER.sde" file on it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 02:41:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169828#M13079</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-01-20T02:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169829#M13080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, the sde connection file is just on my local machine. Are you saying that I need to add the file onto the server and provide a full path to it in&amp;nbsp;my script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 14:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169829#M13080</guid>
      <dc:creator>MichaelTorbett1</dc:creator>
      <dc:date>2017-01-20T14:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169830#M13081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&amp;nbsp; The path to the SDE connection file needs to be accessible by the process executing the script.&amp;nbsp; If the SDE connection file exists only on your machine, and a process on the server has no way to access that SDE connection file, then it will fail.&amp;nbsp; In the code 2 years ago by the OP, the SDE connection file appears to be stored on a file share that was likely accessible by both the desktop and server.&amp;nbsp; In your case, the SDE connection file is stored on the desktop and is inaccessible to the server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 15:00:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169830#M13081</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-01-20T15:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Python Script Runs on Desktop but Not Server</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169831#M13082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked!!!! Thank you for your help Joshua.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 15:51:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-script-runs-on-desktop-but-not/m-p/169831#M13082</guid>
      <dc:creator>MichaelTorbett1</dc:creator>
      <dc:date>2017-01-20T15:51:51Z</dc:date>
    </item>
  </channel>
</rss>

