Solved! Go to Solution.
C:\Program Files\ArcGIS\instantclient;C:\Program Files (x86)\ArcGIS\instantclient_11_2
On your 64-bit machine can you open your SDE connection file in Catalog? Does arcpy.Exists(table) return true?
Are you on SP1?
Can you verify you only have one version of python installed?
Also check what is in your sys.path list in both IDLE and the ArcGIS python window. They should mostly match.
If you're indeed using 64bit Background or 64bit Server you may have some extra work to do.
If you're straight up using ArcMap 10.1 on a 64bit machine, this should "just work". ArcMap and Python are 32bit, thus if it ArcMap connects, Python (32bit) will as well.
If you're using a 64bit product (BG or Server) you'll need to ensure you have the 64bit client libraries to connect.
I believe if you're connecting to SQL Server, both the 32 and 64 bit get installed together (so either works). If you're using Oracle, you'll need both 32 and 64 bit versions of the instaclient and properly set up the information in the PATH variable to 64 first, 32 second (assuming you're using the instaclient). Those are the database flavors I know off the top of my head, instructions probably vary depending on other types.
edit: whats the full Python command you're using in your script? Are you doing:
arcpy.MakeFeatureLayer("c:\data\mysde.sde\sde.FC.pts" .... ) or
arcpy.MakeFeatureLayer("database connections\mysde.sde\sde.FC.pts" .... ) ?
C:\Program Files\ArcGIS\instantclient;C:\Program Files (x86)\ArcGIS\instantclient_11_2
Your python snippet looks perfect.
Not to be picky on words, but are you saying "server" as in the machine you run the script on, or "ArcGIS Server" is what you installed and run the script against.
If ArcGIS Server is the case, ArcGIS Server at 10.1 is 64bit, thus 64bit Python, thus you need 64bit client libraries when connecting to SDE.
Since you can install the instantclient anywhere, I can't say "go look here".
All I can tell you on this subject is in the PATH environment variable you need to set where to find it.
For example, part of my PATH variable looks like:C:\Program Files\ArcGIS\instantclient;C:\Program Files (x86)\ArcGIS\instantclient_11_2
I drop the instant client into my 64bit Server install directory and my 32bit ArcMap install directory (thats just how I manage it). Then in my Path (as shown above), I reference the 64bit one first, followed by the 32bit.
Thank you Kevin, I'm going to install the Oracle instaclient right now, will follow up if this is the solution, as I'm sure others will run into this, if they havent already.
Thank you have taking the time, By the way I'm a Big Fan of your ServerAdminToolkit, thats awesome!!