Select to view content in your preferred language

Error while execution Python code on IDLE

2508
3
Jump to solution
12-08-2014 09:08 AM
SaadiaElaarji
Deactivated User

I'm trying to execute PYTHON code using IDLE but it gives me this error :

I'm using Arcgis 10.1, IDLE (Python 2.7)

Traceback (most recent call last):

  File "C:/Saadia/SAFTOP/Parcelle et rivrains/simulation arcgis/python-script python/azimuth", line 6, in <module>

    cur = arcpy.UpdateCursor("Parcelles_class_FeatureToPoi3")

  File "D:\Program Files\ArcGIS\Server\arcpy\arcpy\__init__.py", line 1165, in UpdateCursor

    return gp.updateCursor(dataset, where_clause, spatial_reference, fields, sort_fields)

  File "D:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\_base.py", line 364, in updateCursor

    self._gp.UpdateCursor(*gp_fixargs(args, True)))

RuntimeError: ERROR 999999: Erreur lors de l’exécution de la fonction.

Impossible d’acquérir un verrouillage.

Impossible d’acquérir un verrouillage.

0 Kudos
1 Solution

Accepted Solutions
DavidBlanchard
Esri Contributor

The "Impossible d'acquérir un vérouillage" message indicates that something else is using the table you are trying to update and ArcPy is unable to acquire an editing lock.

This may be ArcGIS for Desktop (if open in ArcMap or ArcCatalog), or by ArcGIS for Server if published as a service. If this is the case, close ArcGIS for Desktop, or stop the service.

If none of the above apply, it could be Python itself. This could occur if you are attempting to open multiple cursors on the same file, if you are not deleting the cursor once done, or if you script crashed and never got a chance to delete the lock. If this is the case, you may want to look at using the with...as...: syntax with a Data Access cursor. This clears your cursor once the script stops (including after a crash).

View solution in original post

0 Kudos
3 Replies
Zeke
by
Honored Contributor

It's hard to say without seeing your code, but what pops out is it appears you're using the gpscripting code on Arc 10.1, when you should be using arcpy. I don't know what those last two lines are in English, so can't say much beyond that. Post the relevant code, be easier for folks here to debug.

0 Kudos
DavidBlanchard
Esri Contributor

The "Impossible d'acquérir un vérouillage" message indicates that something else is using the table you are trying to update and ArcPy is unable to acquire an editing lock.

This may be ArcGIS for Desktop (if open in ArcMap or ArcCatalog), or by ArcGIS for Server if published as a service. If this is the case, close ArcGIS for Desktop, or stop the service.

If none of the above apply, it could be Python itself. This could occur if you are attempting to open multiple cursors on the same file, if you are not deleting the cursor once done, or if you script crashed and never got a chance to delete the lock. If this is the case, you may want to look at using the with...as...: syntax with a Data Access cursor. This clears your cursor once the script stops (including after a crash).

0 Kudos
DavidBlanchard
Esri Contributor

Also, here's a short technical article I wrote a few years ago about schema locks and how to avoid them. The concepts for 10.1 still apply to 10.2 and 10.3.