Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [syntaxerror]

The tag has no usage guidance.

0
votes
0answers
15 views

Performing iterative Mosaic in ArcPy?

I'm attempting to complete a batch mosaic operation in ArcMap 10.4.1 Python window. I need to run the Mosaic tool about 80 times for sets of three rasters. Basically I want the second and third raster ...
1
vote
1answer
39 views

Syntax error when using concat function

I created a field to display the whole route of several photos in a point layer in order to be able to visualize them on the map. I try to do so by using this expression: concat('C:\Users\DIDAC\...
0
votes
1answer
18 views

Getting SyntaxError from Coordinate Transformation (points) with ArcPy?

I'm trying to do a coordinate transformation for points with ArcPy in ArcGIS Pro by using x and y coordinates as Input. I tried the following: import arcpy inputSRS = arcpy.SpatialReference(31467) ...
1
vote
2answers
60 views

ArcMap Python Code gives SyntaxError?

I've encountered an issue implementing a code into ArcMap. The original code was: for fc in fclist: ... arcpy.Clip_analysis(fc, r’C:\GIS_LabManual\Lab10_Manual\Lab10_data\Arb_clip_poly.shp’, r’C:\...
0
votes
1answer
131 views

Can't import custom Toolbox in ArcPy?

I have a custom made Toolbox and I can't make it run. The Toolbox is called toolbox_k and the tool is called sn I did this: arcpy.ImportToolbox(r"C:\Users\user\Desktop\VST\Toolbox_k.tbx", "sn") I ...
3
votes
2answers
308 views

PyQGIS standalone script using QGIS 3.2

I want to work with PyQGIS Python 3 using QGIS 3.2 standalone install. I created a simple batch file to work with PyQGIS but I have some errors. Here's the batch file: @echo off SET OSGEO4W_ROOT=C:\...
0
votes
0answers
39 views

Understanding SyntaxError in ArcPy?

On the line after the field info I continue to get syntax errors and I'm unable to solve this problem myself, please help me. The purpose of the code is to move a given point within a set distance in ...
0
votes
1answer
71 views

arcpy for loop to save shapefiles as .layer files

I have 150 shapefiles in folder in "D:\ss3\polygons". I want to save each polygon as .layer file with the polygon name in "D:\ss3\layers" However, Python displays: "Parsing error SyntaxError: invalid ...
3
votes
3answers
198 views

Deleting selected rows in ArcPy?

I am new to ArcPy and I am trying to write a code to select specific rows from a shapefile. I wrote this code, which gives back: Parsing error SyntaxError: invalid syntax (line 3) Any suggestions ...
1
vote
1answer
549 views

Syntax Error related to File Path / Name in ArcPy Script

I'm using ArcGIS Desktop 10.2.2. I'm getting the following error when I run a script in Arc. SyntaxError: EOL while scanning string literal The error message points to the line where I set my ...
1
vote
2answers
94 views

Raster calculator syntax in ArcGIS

I'm trying to apply this equation through the raster calculator in ArcGIS: I'm using this syntax: ( ( ( (Raster) ^ 4 ) - (1-e) * ( Sky T ^ 4 ) ) / e ) ^ 0.25 The raster calculator create a ...
0
votes
1answer
53 views

Invalid syntax on export PDF

I'm getting an invalid syntax error on line 20. Anybody see what's wrong? import arcpy import os geo1 = GetParameterAsText(0) goe2 = GetParameterAsText(1) saveLoc = GetParameterAsText(2) exportLoc = ...
2
votes
1answer
90 views

Referencing Bookmarks in Alphabetical Order in Python script tool?

I have a custom script tool that is supposed to set up a map layout, by adjusting the scale bar, north arrow, title, and legend. It is then supposed to reference a bookmark and export the layout as a ...
0
votes
0answers
31 views

No module named “SSUtilities” within Optimized Hot Spot Analysis tool

Background I'm trying to execute Optimized Hot Spot Analysis tool in ArcGIS 10.3 but receive the following error: Additional Information I've had a look at some other tools within the same toolbox ...
1
vote
0answers
97 views

Python Window errors showing when opening up Commands tab in Customize related to Python Add-In?

I'm getting a number of errors in the Python Window on ArcGIS 10.3.1 when going to Customize > Customize Mode... > (Commands Tab) as seen below. The majority of errors are coming from a Python Add-in:...
0
votes
1answer
263 views

Syntax error (python script with arcpy) [closed]

My ArcPy script doesn't run because a syntax error was raised, but I already had checked the syntax and indentation of the entire script. Can anyone help me? The error that was raised points to a ...
2
votes
1answer
128 views

arcpy.da.UpdateCursor gives SyntaxError? [closed]

I'm trying to use Python to: Do a union between 2 layers (LandTrust and Precincts) - this works Create a field called "Overlap - this works Create a da.UpdateCursor to populate the fields with values ...
0
votes
1answer
195 views

Using LIKE clause in update cursor gives syntax error?

I am trying to write a second update cursor within one script. This requires a LIKE condition to look up a value within the same layer to identify rows to update the field within that layer (first ...
2
votes
1answer
87 views

Exporting attachments from FGDB and populating field with picture path

I am trying to export attachments from fGDB and populate fields with the picture link path. I created a script following these instructions http://support.esri.com/en/technical-article/000014520 ...
2
votes
1answer
477 views

Calculating field with hour from date time field with ArcPy?

This expression works in the field calculator to give me the hour from the datetime field called dtrepor arcpy.time.ParseDateTimeString(!dtrepor!).strftime('%H') But how do I call it in python? I ...
1
vote
1answer
204 views

Syntax Error Label Expression Debug

I'm attempting to debug a code for a conditional label expression. The code is based on one i have previously used and did not have any issues. The python code is as follows. def FindLabel ( [TF], [...
1
vote
2answers
202 views

Field Calculator Parsing error SyntaxError: invalid syntax (line 2)

I'm writing a conditional in the Field Calculator and it's giving me an error of syntax in line 2. Can someone see it? The Code Block is this: def ZFactor(LAT_CENTR) : if (10.000 < math.fabs(...
-2
votes
1answer
58 views

Merging two shapefiles using ArcPy?

I have two point features with names o.shp and d.shp. I want to merge both of these files and create a new shapefile with merged attributes. How do I do that? Tried code that did not work: arcpy....
0
votes
1answer
152 views

Debugging SyntaxError from ArcPy?

Can anybody tell me whats the syntax error in the following python command, arcpy.ManageTileCache_management("H:\FV","RECREATE_ALL_TILES",”Visible”, "H:\FV\MosaicData.gdb\FVImages", "IMPORT_SCHEME", ,...
0
votes
1answer
52 views

Syntax Error while using Search Cursor

I am trying to get a search cursor to go through each row and Multi buffer a feature. I keep getting a syntax error with no error codeother than Invalid Syntax (traceback to this line of code) so i ...
0
votes
1answer
85 views

Tool in Toolbar is not visible in Customise Commans tab [closed]

I have added a tool in a toolbar in python addin wizard. And while opening arcmap I am getting the error :--- c:\arcgis\ArcToolbox\Toolboxes\Space Time Pattern Mining Tools.pyt ^ SyntaxError:...
1
vote
2answers
310 views

Label specific lines in attribute table with syntax- ArcGIS?

I try to label a point layer for values in lines 1-11 only in this attribute table in field "OBJECTID" with this syntax (i saw this question also Labeling specific features in ArcGIS for Desktop?): ...
1
vote
1answer
279 views

Identifying row and column location of a raster image using ArcGIS 10.1

The solution already available online gives a python syntax error ERROR 000989 Python syntax error: Parsing error SyntaxError: invalid syntax (line 1) when I write $$rowmap + 1 in map ...
3
votes
2answers
739 views

SyntaxError from Python Label Expression in ArcMap?

I am trying to use a find label expression that changes the font of one field, [NUMBERNAME]. I am using the Python parser of ArcGIS 10.3.1 for Desktop. All fields have a data type of text. This is ...
-1
votes
1answer
397 views

Syntax error using ArcPy Spatial Analyst module in Python [closed]

I'm very new to using python and figure I'm missing something obvious in the following script. I keep getting a "syntax error" message no matter how much I fiddle around with the first few lines. I ...
0
votes
1answer
134 views

Why does Animal Movement toolbox give SyntaxError: invalid syntax?

I found a complete toolbox (Animal Movement tbx, by Regan Sarwas) for my tasks and I tried it. I had a systematic problem with the codes for all tools (line 1), for exemple: Executing: ...
3
votes
1answer
1k views

Updating layer datasource in multiple map documents using ArcPy gives SyntaxError?

I would like to update the data source of a specific layer in multiple map documents using ArcPy. However, I'm getting a <type 'exceptions.SyntaxError'>: invalid syntax error on if lyr....