Stack Exchange Network

Stack Exchange network consists of 174 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 [attributeerror]

an AttributeError is one of the built-in exceptions for Python. It is raised when an attribute reference or assignment fails.

1
vote
0answers
37 views

GeoPandas geocode error when using Nominatim

I am following this lesson about Geocoding. I have entered: # Import necessary modules import pandas as pd # Filepath fp = r"addresses.txt" # Read the data data = pd.read_csv(fp, sep=';') data....
2
votes
0answers
25 views

Clipping outside QGIS with PyQGIS?

This is my first script and I having a problem trying to clip a shp file. I'm running on a linux server and this is my code: #! python from datetime import date from qgis.core import * from PyQt4....
1
vote
1answer
73 views

Getting AttributeError from ArcPy?

I'm working on a simple Python code to make a raster from a shapefile using the Natural Neighbors tool, and then use the resulting raster to generate a contour using the Contour tool. I keep getting ...
0
votes
1answer
59 views

Tried running a script, kept getting “AttributeError: DescribeData: Method spatialReference does not exist”

Anyone know how i can fix this problem below? I am trying to merge all the layers under the same name in different subfolders. import arcpy import os # parameters input_folder = arcpy....
0
votes
0answers
182 views

AttributeError: Myclass instance has no attribute 'x'

I am trying to select a feature from the layer using my plugin. When working with my plugin in main Python function using QGIS, I receive an AttributeError when I call a class method from within the ...
0
votes
1answer
100 views

Features show on data view, but not in Attribute table?

There are 966 points for tree data that was collected in the field. When I try to open the attribute table only 2 points' data show up. I've tried to create layer from selected, because when I choose ...
1
vote
1answer
2k views

AttributeError: 'NoneType' object has no attribute 'pushButton'

I am using pyqt5 working in Qgis to create a simple plugin, i started by creating a pushButton wit QtCreator and create an event using this code : from PyQt5.QtCore import QSettings, QTranslator, ...
0
votes
2answers
110 views

arcpy.Delete_management not working?

I've updated the code with the suggestions in the code but still not working. arcpy.env.workspace = r'F:\EGM722 - Customising GIS apps\Assignment\folklore.gdb' arcpy.env.overwriteOutput = True arcpy....
2
votes
0answers
669 views

QGIS Error: Join attribute by location

I'm getting this error code with QGIS when I am using the tool Join attribute by location: I'm trying to join the attribute table of polygons into my vector points attribute table. Processing ...
3
votes
2answers
70 views

Duplicating existing polygons based upon number in attribute field using ArcPy gives AttributeError?

We are working with parcel data that includes a single polygon for each individual tax parcel. We need to develop a list that includes an attribute for each residential address. Some tax parcels could ...
1
vote
0answers
71 views

Debugging AttributeError Invalid destination path from ArcPy? [duplicate]

I am struggling with using Python to export an mxd to PDF. The final PDF would have 4 pages, each with the same extent but with a different layer displayed. Below is the code I entered into the ArcMap ...
0
votes
0answers
377 views

AttributeError: 'unicode' object has no attribute 'replaceWorkspacePath' [duplicate]

I must of written this code using 15 different structures with no luck. I am simply trying to take an old layer 'Windfarms' stored in 'C:\Users\darle\Desktop\MXD_Test\Test.gdb' and replace it with '...
1
vote
1answer
3k views

AttributeError: class instance has no attribute 'class_function'

When working in my plugin's main python function, I receive an AttributeError anytime I call a class method from within the class itself. For example the sample code below: class PluginName: def ...
1
vote
1answer
1k views

AttributeError: 'NoneType' object has no attribute 'asPoint'

I'm new to QGIS, and have never used the Python console. I have created a complex layer in QGis using an experimental, plugin which I had to manually install. It contains 91506 features; lines going ...
1
vote
0answers
177 views

AttributeError: 'NoneType' object has no attribute 'RasterCount'

Any idea what this error means? AttributeError: 'NoneType' object has no attribute 'RasterCount' I get this error when I am trying to save a ROI in QGIS (within the SPC plugin). I have uploaded a ...
-5
votes
1answer
99 views

ArcPy Describe function gives AttributeError? [closed]

import arcpy infc = r"C:\Users\123\Desktop\文件\test.shp" print infc desc = arcpy.Describe(infc) print desc shapefieldname = desc.ShapeFieldName print shapefieldname rows = arcpy.SearchCursor(infc) ...
3
votes
2answers
462 views

Python AttributeError working with QGIS Plugin-Builder

I started to develop my own QGIS plugin today and I was pretty confident when browsing through all the different literature and tutorials available on the web. I started this beginners tutorial and ...
0
votes
0answers
212 views

What other tool/s can achieve the same result in arcgis desktop as the SearchWithin tool for arcgis pro?

I have building parcels inside of some buffers. I want to calculate how many parcels, what is their sq. acreage and average parcel size of the parcels within EACH buffer. The Search Withintools claims ...
1
vote
2answers
283 views

Using ArcPy cursor to concatenate row values?

I am ArcGIS 10 user and I want to create ArcPy script for simple concatenate row values like this tool Concatenate Row Value that works with ArcGIS 10. I have three fields in my shapefile id,field1,...
1
vote
0answers
175 views

Debugging AttributeError: 'module' object has no attribute 'runalg'? [duplicate]

I want to use QGIS and processing to run some tasks that would be redundant to do by hand. When I try to run a script as a stand alone I get the error AttributeError: 'module' object has no ...
0
votes
1answer
45 views

Arcpy debug question

I'm running this script to iterate through layers, zoom to them, then export each as a pdf but I keep getting this error: AttributeError: 'str' object has no attribute '_arc_object' I'm not skilled ...
3
votes
2answers
257 views

AttributeError when using arcpy.GetParameterAsText()?

I found a script to batch export geotiffs from data view and when hard coded it work well mxd = arcpy.mapping.MapDocument("CURRENT") res = 200 #resolution of tif export = "S:\\6 - GIS\\For Randoms\\...
4
votes
2answers
1k views

Using fieldinfo.setVisible in ArcPy?

I went through the documentation, and searched around but wasn't able to figure this out. What I want to do is export shapefiles, but have certain fields turn off. I was successful in turning off ...
1
vote
0answers
81 views

Batch converting 10.4 mxd files to 10.1 with ArcPy gives AttributeError: MapDocObject: Unable to save?

Closely related to Converting .mxd files that were created with 10.3 to .mxd files that are compatible with 10.1, except I am running ArcGIS 10.4. It should be possible for me to make 10.1 copies of ...
1
vote
1answer
128 views

Incrementing ID with DA Update Cursor

I'm currently applying a select by attribute query to select null values before applying an increment cursor, but I'm interested in reducing the code by using a where clause and employing the updated ...
1
vote
1answer
652 views

Zoom to extent using ArcPy?

Working on being able to zoom to the extent of features in a search row to produce individual maps for row (like data driven pages but for individual rows on the dataset). I just can't seem to get it ...
-2
votes
2answers
71 views

Converting all layers to Excel using ArcPy?

I'm trying to convert all layers in a folder to excel tables and keep the same file names. Here's what I have so far and the error I got. arcpy.env.workspace = "C:/layersFolder/" layers = arcpy....
3
votes
1answer
652 views

AttributeError: 'int' object has no attribute 'setName' (or insertChildNode)

I am trying to make group and fill it with layers in pyQGIS. Piece of my code: from PyQt4 import QtCore, QtGui from PyQt4.QtCore import QFileInfo from qgis.core import * from qgis.utils import ...
-1
votes
2answers
304 views

Counting number of instances of certain field value using ArcPy?

I am creating code that accesses a shapefile named Schools.shp. I data I am trying to locate is the attribute field named FACILITIES. Within the FACILITIES field I am trying to get values that the ...
1
vote
1answer
347 views

Arcpy - AttributeError: PageLayoutObject: Error in executing ExportToPNG

I’m building a custom tool, where you input the city and state and the tool outputs an image file of a map with certain features buffered, labeled, etc. I’m running into problems on the last step, ...
0
votes
1answer
107 views

Attribute error while running the Toolbox and Model

When I am trying to run the following code import arcpy from arcpy import env env.workspace = r"C:\Users\Rvg296\PycharmProjects\Lab6" tbx=r"C:\Users\Rvg296\PycharmProjects\Lab6\UTD.tbx" arcpy....
5
votes
1answer
1k views

Converting .mxd files to be compatible with earlier version? [duplicate]

I am running ArcMap 10.1. I need to open a .mxd that saved using 10.3, however, I do not have access to 10.3. I tried to execute a python tool that was created using Esri's How To: Save map documents ...
0
votes
2answers
61 views

Mosaicing rasters in arcpy

I am mosaicing rasters in arcpy but it is returning the error, AttributeError: 'module' object has no attribute 'MosaictoNewRaster_management' I am using the code: import arcpy from arcpy.sa import *...
2
votes
1answer
186 views

AttributeError: 'SpatialReference' object has no attribute 'ImportFromESPG'

I am trying to create a spatial reference using ImportFromESPG and this is what is returned: AttributeError: 'SpatialReference' object has not attribute 'ImportFromESPG' Code and error are copied ...
0
votes
1answer
186 views

Python brkLyr.supports (“dataSource”) Error?

This is supposed to loop through a directory of MXD's and look for broken links and create a report. I am getting an error, an exception I believe, on one of the data sources. In the MXD it shows a ...
7
votes
1answer
7k views

Debugging AttributeError: 'module' object has no attribute 'Parameter' from Python Toolbox of ArcPy?

I have a big .pyt script (python toolbox) and now i trying split it to many files (1 file - 1 tool). In single .pyt file everything works perfectly, but when file is splited i get this message: ...
4
votes
2answers
1k views

Debugging ArcPy ImportToolBox AttributeError: Object: Tool or environment <ConcatenateRowValues_AA> not found?

I am trying to use the ConcatenateRowValues tool provided by ESRI. My overall code for my script is working fine except when it tries to use the ConcantenateRowValues Tool. I start by importing the ...
2
votes
1answer
2k views

ArcPy script error - NoneType object has no attribute X

I'm familiarising myself with using scripting in ArcMap 10.2 and as part of this I'm using the following to extract vertices from some polygons. ... ... import arcpy ... from arcpy import env ... ...
3
votes
3answers
924 views

Duplicating polygons in Layer using ArcPy cursors gives AttributeError: 'tuple' object has no attribute 'getValue'?

I am trying to Duplicate some polygons in the same layer with the same attributes, But it will duplicated them with Null Geometry, i have tried getValue() method, but i got error import arcpy ...
2
votes
1answer
981 views

AttributeError with unicode object with data frame in python script

I'm running a python script from arccatalog and it works, however, I am trying to add layers to an mxd and need to declare the data frame. I keep getting this error message. type 'exceptions....
2
votes
1answer
994 views

Debugging AttributeError: 'module' object has no attribute 'core'? [closed]

I'm having a problem to get my python scripts running in ArcMap. I keep getting this message no matter what script i use. Executing: Script1 Start Time: Thu Dec 05 15:37:50 2013 Running script ...
1
vote
0answers
226 views

AttributeError: Error in getting tool information when using TableToTable tool [closed]

I am trying to use the arcpy.TableToTable_conversion tool in my python script, but seem to be getting the following error on the line arcpy.TableToTable_conversion("FINAL_NLPG", myTempWorkspace,...
2
votes
2answers
752 views

Update ArcPy version to avoid AttributeError: 'module' object has no attribute 'GetClassNames'?

This is probably the answer to my previous question: Listing Elements or Datasets of Layer gives ERROR 000840 value is not Feature Layer?. The version of arcpy that I am using does not include ...
4
votes
3answers
5k views

AttributeError: MapDocObject: Unable to save on mxd.save/saveACopy?

I'm trying to use arcpy to save an .mxd and am having an issue. It doesn't matter if I use mxd.save or mxd.saveACopy I get the same error. I know it doesn't look like I am doing anything w/ it here, ...
10
votes
1answer
2k views

arcpy.geometry __geo_interface__ and AsShape() function: loss of precision and holes

I'm serializing my arcpy geometries as geojson so that I can 'hydrate' them back as geometries later and I'm having 2 problems in the cycle.: PROBLEM 1: Precision R0 = arcpy.SearchCursor(self....