0

For some reason, I can't get Buffer_analysis to run successfully from PyScripter(2.5.3.0) for a particular shapefile. It fails to complete and exits with error 999999. I can run the exact same command and data in ArcMap(10.1 SP1) and it completes with no errors.

Can somebody suggest a reason why this may happen and possibly a solution? I have noticed this with other commands as well. It runs fine in ArcMap, but has problems in PyScripter.

5
  • What version of ArcGIS for Desktop are you using? You can use the edit button below your Question to revise it with this detail. Also, out of curiosity, have you tried the same one-liner (plus import arcpy) in IDLE? I would expect this to work in that before ArcMap.
    – PolyGeo
    Commented Jan 24, 2014 at 8:36
  • 1
    I just tried it with IDLE and it works. So, why does PyScripter fail?
    – jger
    Commented Jan 24, 2014 at 8:55
  • 1
    This could be because Arcmap sees 4gb of memory, while python only 2gb, assuming you are running on 64 bit Windows. Google for "arcmap large address aware python" and check the first link. You'd have to custom build python to make it see 4gb.
    – 0kcats
    Commented Jan 24, 2014 at 9:08
  • I just installed the 64bit version of PyScripter and it works now. I will do some more testing before answering my own question.
    – jger
    Commented Jan 24, 2014 at 9:08
  • Been using 32-bit 2.5.3.0 PyScripter w/32-bit ArcGIS 10.0-10.2 w/no problems like this. I'm thinking that the arcpy environment (e.g., arcpy.env.workspace) is different there than w/in Desktop apps. I'm wondering which version of arcpy is being run w/in ~jger's 64-bit Pyscripter (some info on checking paths).
    – Roland
    Commented Feb 3, 2014 at 23:48

1 Answer 1

1

I started receiving the dreaded 999999 code on one of two servers running the exact same script. After much debugging, we found that some of the optional flags are required.

In our case, we changed:

arcpy.Buffer_analysis(clip_extent, outputClipFeatureClass, buffer_distance)

to:

arcpy.Buffer_analysis(clip_extent, outputClipFeatureClass, buffer_distance, "FULL", "FLAT")

Interestingly, both FULL and FLAT parameters are optional according to documentation and FLAT isn't even valid on a polygon feature class: http://help.arcgis.com/En/Arcgisdesktop/10.0/Help/index.html#//000800000019000000

We're run into a few cases of this (Arcpy tools requiring extra parameters), hopefully this will help someone in future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.