MakeFeatureLayer works in ArcMap, fails in ArcPy

3869
10
08-20-2015 11:58 AM
BrandonNelson1
New Contributor III

I have an ArcPy script that worked with ArcGIS Desktop 10.1, but after upgrading to 10.3, it fails trying to MakeFeatureLayer:  error 000732, "Dataset ... does not exist or is not supported").  I'm 100% sure the dataset exists and the path is correct.  Executing the command manually from the Python CLI results in the same error, but from within ArcMap or ArcCatalog it succeeds; I see the same behavior on several different machines.

Has this occurred for anyone before?  Where else can I look to determine the source of the problem?

PS:  Oddly enough, running the command and/or script from Python on our GP server (not ArcGIS Server; it runs regular maintenance GP tasks) does work, even though as far as I'm aware the software is set up almost identically.  Of course the server has more memory, but would that make a difference for something like creating a feature layer?

0 Kudos
10 Replies
JoshuaBixby
MVP Esteemed Contributor

Do you have 64-bit Background Geoprocessing installed?  Do you have other ArcGIS products installed, like ArcGIS Engine, on the machine that generates the error from the CLI?  What type of data store is it?  File geodatabase, Personal geodatabase, shapefile, SDE?

I not-to-uncommonly run into users that have ArcPy code break after they install 64-bit Background Geoprocesisng or ArcGIS Engine because the default Python interpreter gets changed from 32-bit to 64-bit versions.  Changing the default file type association or having the user call the script using a specific Python interpreter usually solves the problem.

0 Kudos
BrandonNelson1
New Contributor III

Thanks for your response.  I hope this sheds some more light on the issue:

The only other ArcGIS software packages installed are the Data Reviewer and Production Mapping extensions, and ArcGIS Pro.  I'm accessing feature classes from an SDE database; I copied them to a file geodatabase and did not receive an error.  (This isn't viable as a long-term solution, however, since the script needs to use the data in SDE.)

The ArcMap and standalone Python binaries are version 2.7.8, 32-bit (verified with `sys.version' and `platform.architecture()'); the only 64-bit version I can find is a Python 3 DLL in the Pro folder.

At your suggestion, I also tried running Python with the full path to the executable, but the error still occurs.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

What's your backend DBMS?  Oracle, SQL Server, Postgresql, etc....  What are the SDE connection file parameters?  Where is the SDE connection file stored, under 'Database Connections?'

0 Kudos
BrandonNelson1
New Contributor III

SQL Server 2012, 64-bit.  I've tried both OS authentication and Database authentication with the admin account.  The connection file is stored in "Database Connections," but I still got the same results copying it to C: root.  We're still testing on more systems here, but so far it seems that server is the only one able to connect through ArcPy (fortunately it is able! :-).  Our other server with ArcPy is outward-facing, and has no access to the SDE server.

0 Kudos
MichaelVolz
Esteemed Contributor

Did you ever disable background geoprocessing in v10.3 as I believe it is enabled by default?

0 Kudos
BrandonNelson1
New Contributor III

Yes, Background GP is disabled.  We've had other issues that were caused and/or exacerbated by it so now that's one of the first things I do.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

If a machine with ArcGIS for Server can connect, but machines with only ArcGIS for Desktop (minus 64-bit Background Geoprocessing) cannot connect, it makes me think there is a 32-/64-bit issue involved somewhere.  What would be an interesting experiment is to install 64-bit Background Geoprocessing on one of the ArcGIS for Desktop machines and then force the script to run using the 64-bit Python interpreter instead of the 32-bit one.

0 Kudos
BrandonNelson1
New Contributor III

I guess it's worth investigating, though I don't think the server has 64-bit installed either.  Does ArcPy even consider the Background Processing setting?  I thought it was basically independent from ArcMap/Catalog.

Just to clarify, though, the "server" is actually running ArcGIS for Desktop, it's only a server in the sense that it regularly operates with little to no user interaction.  It mostly runs maintenance tasks (daily data refresh, scheduled reports, etc).

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Oh, I misunderstood.  I thought you meant ArcGIS for Server, which has been 64-bit only for several versions now.  In your case, I am not sure what to suggest.

0 Kudos