Questions tagged [syntaxerror]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

Calculation problem

Trying to calculate terms and failing.I'm trying to figure out what's the problem? Indicates that all documents are on an external disk and not on the computer. if("area" <=1000, $...
user avatar
1 vote
0 answers
33 views

ArcGIS Pro field calculator based on values code [closed]

I'm trying to calculate a field to produce symbol codes for GPS units based on a field "Grade". I've tried cobbling together the code based on samples I found; but got syntax error. The Code:...
user avatar
  • 11
2 votes
0 answers
25 views

Property from Expression in Shell Script

I am using qgis_process in a shell script (Linux) to make a buffer using a field as the distance. I can get a buffer from the shell with qgis_process run qgis:buffer INPUT=pt.shp OUTPUT=buffered.shp ...
user avatar
  • 21
0 votes
1 answer
147 views

Using variable for property name in Google Earth Engine ee.Feature

I would like to know if it is possible to set a property name using a computed variable in GEE. For example, I create the following feature: var feature = ee.Feature(null,{propertyName: 0.85}); and ...
user avatar
0 votes
1 answer
71 views

Invalid syntax on arcpy.conversion.FeatureClasstoFeatureClass()

I am using ArcGIS Pro 2.8.1. In a Python script tool, I am trying to get a list of feature classes as an user supplied input parameter, and export all of them with an additional text string that is ...
user avatar
  • 452
0 votes
2 answers
41 views

Getting SyntaxError when trying to loop through shapefiles in folder, calculate Euclidean distance and save files with appended name using ArcPy

I want to loop through shapefiles in a folder, calculate Euclidean distance and then save the files in an output folder with an appended name in arcpy. I want the name to be the filename with "...
user avatar
  • 413
2 votes
1 answer
165 views

QGIS Field Calculator Syntax Error Problem

I never before worked with the field calculator and this problem is driving me nuts ... Interpretationserror: syntax error, unexpected NAME syntax error, unexpected ')', expecting $end My expression ...
user avatar
0 votes
2 answers
51 views

SyntaxError running AssignDomainToField_management function for ArcMap

I'm trying to set a domain for a feature class field using the below syntax and IDLE keeps giving me an invalid syntax error with no specifics. I can't find which line it's rejecting to even begin ...
user avatar
0 votes
1 answer
147 views

ArcPy replacing network mapped drive with UNC

I am writing a script in Python to look in the current MXD for paths which are on a mapped network drive instead of the UNC path to the network. However I am getting a syntax error. I am not very ...
user avatar
  • 11
0 votes
1 answer
39 views

Ending Python if-then using triple double quote gives EOL while scanning string literal [closed]

I keep getting the same error, I think it's because of how I end my if-then statement. It basically looks like this, except it's much longer (like, 300 lines long). myIfThenVariable="""...
user avatar
0 votes
0 answers
31 views

SyntaxError from Python Script tool written using ArcPy

I am in an advanced GIS course and was assigned to create a simple tool that is used in the ArcMap toolbox that allows the user to create a buffer of 100 feet. This is the code that I have so far. ...
user avatar
  • 1
-2 votes
1 answer
69 views

SAGA RESAMPLING SYNTAX

How can I solve the problem shown below: I am trying to build a plugin that allows me to resample the raster data to any desired resolution of my choice with 20 being the minimum input value, as ...
user avatar
2 votes
1 answer
337 views

Double precision error on user defined type

There is user defined type which consist of double precision type and integer. It looks like it CREATE TYPE ZOOM_LVL AS ( eps FLOAT8, minptrs INTEGER ); This function is used to set the value to user ...
user avatar
1 vote
0 answers
34 views

Problem creating a simple two-branch if-then-else logic (script tool) in ArcToolbox

I'm new to Arcpy and script writing and i'm trying to create a two-branch if-then-else logic based on the shapefile type of the input data. What I want to do is to write a script tool that executes ...
user avatar
1 vote
0 answers
80 views

Python command for QGIS that iterates over .xyz files doesn't work [closed]

I have a small Python script for QGIS that goes to a folder and iterates over its files and uploads all .xyz files. This is the script: import glob, os dir = r"C:\Users\User\Desktop\xyz_daten" ...
user avatar
  • 2,287
1 vote
0 answers
104 views

Error using PST(Place Syntax Tool) in QGIS

I'm working with the PST(Place Syntax Tool) that I want to create segment map (Geometry is LineString) in QGIS. I'm having the problems with these errors below An error has occurred while executing ...
user avatar
1 vote
2 answers
491 views

Using Select by Attribute within a for loop

I am trying to iterate through a feature layer of counties, using each row as the selection expression for Select by Attribute. This selection will then be used to clip another layer. The goal is to ...
user avatar
  • 379
1 vote
0 answers
196 views

Python Stand Alone Script Parsing error SyntaxError: invalid syntax (line 1)

I'm pretty new to python, but I'm trying to transpose a time field for a set of data I'm working with in ArcMap. I changed the file locations and fields to my needs. However, when I try to run the ...
user avatar
0 votes
0 answers
112 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 ...
user avatar
1 vote
1 answer
240 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\...
user avatar
  • 63
0 votes
1 answer
35 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) ...
user avatar
1 vote
2 answers
176 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:\...
user avatar
0 votes
1 answer
826 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 ...
user avatar
5 votes
2 answers
567 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:\...
user avatar
  • 1,023
0 votes
0 answers
43 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 ...
user avatar
  • 1
0 votes
1 answer
149 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 ...
user avatar
3 votes
3 answers
928 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 ...
user avatar
  • 51
23 votes
4 answers
17k views

Using OSGeo4W shell with Python 3

I would like to use OSGeo4W shell with Python 3 but when typing python3 I get the following error: Fatal Python error: Py_Initialize: unable to load the file system codec File "C:\OSGEO4~1\apps\...
user avatar
  • 2,039
1 vote
1 answer
2k 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 ...
user avatar
  • 1,187
1 vote
2 answers
209 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 ...
user avatar
0 votes
1 answer
127 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 = ...
user avatar
  • 307
2 votes
1 answer
185 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 ...
user avatar
0 votes
0 answers
72 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 ...
user avatar
  • 236
1 vote
0 answers
207 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:...
user avatar
0 votes
1 answer
376 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 ...
user avatar
  • 3
2 votes
1 answer
220 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 ...
user avatar
  • 135
0 votes
1 answer
408 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 ...
user avatar
  • 313
2 votes
1 answer
186 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 ...
user avatar
3 votes
1 answer
1k 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 ...
user avatar
1 vote
1 answer
303 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], [...
user avatar
1 vote
2 answers
366 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(...
user avatar
-2 votes
1 answer
78 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....
user avatar
  • 755
0 votes
1 answer
166 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", ,...
user avatar
  • 13
0 votes
1 answer
111 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 ...
user avatar
0 votes
1 answer
125 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: ...
user avatar
  • 193
1 vote
2 answers
610 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?): ...
user avatar
  • 3,972
1 vote
1 answer
501 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 ...
user avatar
  • 11
3 votes
2 answers
1k 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 ...
user avatar
  • 901
-1 votes
1 answer
439 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 ...
user avatar
0 votes
1 answer
139 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: ...
user avatar