Skip to main content

Questions tagged [attributeerror]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
59 views

"AttributeError: ArcSDESQLExecute: StreamExecute ArcSDE Extended error 900 ORA-00900: invalid SQL statement" error when running SQL query via ArcPy

I am trying to run a SQL query in ArcGIS Pro ArcPy and I am getting errors. I have looked into the ArcSDESQLExecute sample query. https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/...
MapGeek's user avatar
  • 49
2 votes
1 answer
118 views

AttributeError: 'GeoSeries' object has no attribute 'is_valid_reason' in GeoPandas

I was going over the documentation for checking on valid geometries. When I wanted to try the example for is_valid_reason, got this error: import geopandas as gpd from shapely.geometry import Polygon ...
saQuist's user avatar
  • 868
0 votes
0 answers
86 views

Issue with Google Earth Engine Plugin in QGIS

I am trying to resolve an error from using the Python console on QGIS. I have QGIS version QGIS version 3.34.4-Prizren on my linux Ubuntu 22.04.4 LTS, Codename-Jammy. Then I successfully installed ...
TG_'s user avatar
  • 1
0 votes
1 answer
49 views

AttributeError: 'ArcGISProject' object has no attribute 'listStyleItems'; ArcGIS Pro 3.1.4; Python Notebook

aprx = arcpy.mp.ArcGISProject( path_in + name_in) aprx.listStyleItems() returns: AttributeError: 'ArcGISProject' object has no attribute 'listStyleItems' While all other functions work (https://pro....
Rebecca's user avatar
  • 63
0 votes
1 answer
77 views

Getting arcpy has no attribute mapping error when running python code for Loop of MXD layer change

I am brand new to Python and trying to change out a shapefile in several MXDs to a GDB layer. When I run the following I get the error 'arcpy has no attribute mapping' error. I have seen where this ...
Anonymous's user avatar
0 votes
0 answers
47 views

pyModis createMosaicGDAL AttributeError

I've been playing around with the convertmodis_gdal module in pyModis. I've successfully downloaded HDFs, but I've run into a wall mosaicking them. The following is what I've posted on the pyModis ...
kaminka-krasovsky's user avatar
0 votes
0 answers
135 views

QGIS Plugin - How to import external libraries

I'm developing a plugin for QGIS that uses external libraries such as OSMnx, Shapely, and Scikit-learn. In particular, the last one is an optional dependency of OSMnx. At first I created a lib folder ...
Gianmarco's user avatar
0 votes
2 answers
306 views

arcpy.mapping ListLayers to arcpy.mp listLayers

I am working on updating a Python 2 script (arcpy.mapping) to a Python 3 script (arcpy.mp). I've successfully updated the following: aprxFile=r"G:\usr\Drinking Water Programs\Monroe 2023-02\Maps\...
abbyejohnson's user avatar
1 vote
0 answers
178 views

Qgis Plugin spectral library tools : AttributeError type object 'QgsMapLayerProxyModel' has no attribute 'Filters'

I work with unbuntu 22.04.03 LTS. And Qgis 3.34.0-Prizren. I installed the last version of the plugin spectral library tools. But when i try to enable it via the plugin manager interface, i get a ...
user35117's user avatar
  • 929
2 votes
1 answer
77 views

AttributeError in QGIS model during batchmode processing

I'm running a custom model from in batch mode. It has the following tools: Raster Calculator Polygonize (raster to vector) (GDAL) Simplify A lot of field calculators Drop field(s) (the final tool in ...
saQuist's user avatar
  • 868
1 vote
1 answer
136 views

AttributeError: 'QgsNetworkAccessManager' object has no attribute 'setTimeout' when calling QGIS plugin

Do you know what is causing this issue? Couldn't load plugin '_plugin' due to an error when calling its classFactory) method AttributeError: 'QgsNetworkAccessManager' object has no attribute '...
Przemek's user avatar
  • 13
3 votes
1 answer
116 views

AttributeError when creating list field with QVariant in QgsVectorLayer using PyQGIS

I am trying to create a list-type field for the active layer using the code below, which is not working. Is there any other way to create a list-type field and update the list([1,2,3]) as an attribute ...
Ganesh S's user avatar
0 votes
1 answer
184 views

GEE Python API method 'prepare_for_export' not available

I want to prepocess a batch of Sentinel-2 images using the code provided by ndminhhus. Earth Engine authentication, Py6S, custom module "atmospheric", basically all necessary modules have ...
Barbara Perez de Araújo's user avatar
4 votes
1 answer
1k views

"AttributeError: 'dict' object has no attribute 'fields'" error when creating and deleting fields in the attribute table using PyQGIS

I am currently making a code that will buffer the points then extract vertices and add new coordinates. but I also want to change the "max depth" column to "Height Theo" and then ...
PyCher's user avatar
  • 171
0 votes
1 answer
957 views

Python script to copy layout template and create new layouts based off other maps in ArcGIS Pro

I am trying to write a script to use in the ArcGIS Pro Python console which copies an initial layout from an APRX (Layout1) below, then uses this to create multiple layouts which use other maps within ...
RD123's user avatar
  • 1
3 votes
1 answer
264 views

Numerical digitize give a stack trace error on all releases after 3.18 [closed]

I use the numerical digitize plugin often and it no longer functions in versions of QGIS released after 3.18. Please help or offer another option. The error is as follows 2023-03-25T14:42:28 ...
Jason Owsley's user avatar
3 votes
2 answers
102 views

AttributeError when calculating area in hectares in PyQGIS

I want to calculate the area of the polygon and add it to the attribute table as another column. I used this script: from qgis import processing inlayDir = iface.activeLayer() P3_boundary = r'C:\...
PyCher's user avatar
  • 171
-1 votes
1 answer
202 views

AttributeError when modifying vector layer symbology with PyQGIS

In QGIS 3.22 I'm facing a problem with QgsMapLayer. I want to use it on QGIS in order to modify the symbology of line, point & polygon in each layer but every time it gives me an error on using ...
Sanaa Ben's user avatar
1 vote
1 answer
511 views

AttributeError: DescribeData: Method shapeType does not exist

Can anyone help me resolve this error? Traceback(most recent call last): File "*file.py", Line 15 in if (arcpy.Describe(lyr).shapeType) == 'Polygon': AttributeError: DescribeData: Method ...
SaltyPatriot's user avatar
2 votes
1 answer
446 views

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

I get the error: AttributeError: 'NoneType' object has no attribute 'selectByExpression' The first run through the loop is fine but at the second run the error occurs. How do I fix this? import ...
Sander Van Beuningen's user avatar
0 votes
2 answers
107 views

Converting threshold MNDVI from Google Earth Engine to Jupyter Python?

I want to convert the script threshold for MNDVI from Google Earth Engine (JavaScript) to Jupyter (Python). In this case, we make the threshold to 4 class MNDVI and the result is one layer, like this ...
putrimegi's user avatar
0 votes
0 answers
247 views

Viewshed error QGIS

I'm a newbie to SE (and to QGIS), wondering if you could give me a hand with an error I don't know how to fix. I am doing a vis analysis in QGIS, viewshed keeps showing the error AttributeError: '...
Irene's user avatar
  • 1
0 votes
1 answer
663 views

Fixing AttributeError: 'module' object has no attribute 'MakeRasterLayer_management'

I'm trying to change my slope map's labels and colors to the specific ones I want which are shown in the code, but when I run this script it produces an AttributeError that doesn't make sense to me ...
Darell's user avatar
  • 45
0 votes
0 answers
271 views

Applying functools.reduce to make Geopandas geometries valid for unary_union

I want to calculate the total area of a GeoDataFrame, year_df, where the geometries overlap so I need to take the union. I was running into an issue with unary_union (some TopologyException that the ...
user1880610's user avatar
4 votes
1 answer
336 views

Changing stroke width of polygon with categorized symbology using PyQGIS

I have a polygon layer with categorized symbology. I want to change the stroke width of all the categories without touching the categories or colours. Here is the script I have after looking a similar ...
JUNGLE's user avatar
  • 530
2 votes
1 answer
474 views

Putting shapefile on map in ArcGIS Online using ArcGIS Python API and Jupyter Notebook

I inserted a shapefile (in .zip as required) to ArcGIS Online through Jupyter notebook: from arcgis.gis import GIS my_gis = GIS() m = my_gis.map() #let's put the shape file to AGOL shp_item = my_gis....
Estiivan's user avatar
  • 405
1 vote
1 answer
2k views

QTableWidget hoizontalHeaderItem is returning None

I am developing a tool is Qgis3 using PyQt5. I am adding columns using a button and the setting column names using 'setHorizontalHeaderItem'. But it gives None while trying to read it. Following is ...
vigna purohit's user avatar
2 votes
1 answer
2k views

Attributes disappears from KMZ-file when imported in QGIS

I have a KMZ-file with polygons that I want to edit in QGIS. When I open it in Google Earth it has some attributes, when I open it in QGIS the attributes disappears or look different. How do I get the ...
Lofoten's user avatar
  • 41
4 votes
1 answer
2k views

GeoPandas write esri-shape file failure: AttributeError: 'DataFrame' object has no attribute 'to_file'

I've got a geodata-frame like this: grid_up2geo.head() Out[13]: jahr la3_id ... 0 geometry 0 2000 1 ... 0 POLYGON ((2690000.000 4342000.000,...
Udo's user avatar
  • 41
1 vote
0 answers
1k views

AttributeError: type object 'object' has no attribute '__getattr__'

I have made a PyQt application where I load UAV images and I display the coordinates (lat, long) according to where the mouse pointer shows. I use this code: Converting a pixel coordinate in GeoTIFF ...
Steven's user avatar
  • 137
6 votes
1 answer
771 views

"AttributeError: 'str' object has no attribute 'crs'" when referring to vector line layer object

I need to test if a vector layer, chosen by the user, is in geographic coordinates, according to the code below: class RoadSlopeCalculatorAlgorithm(QgsProcessingAlgorithm): def initAlgorithm(self, ...
MLourdes's user avatar
  • 198
2 votes
1 answer
698 views

Crayfish plugin doesn't work in QGIS 3.20 [closed]

I have installed QGIS 3.20 in my computer and wanted to use crayfish plugin for Mesh analysis. When I install the plugin it shows the following error and the plugin does not appearing in the toolbox ...
maiyourathaan's user avatar
1 vote
1 answer
2k views

Python attribute error class has no attribute dlg

I am trying to create a plugin for QGIS, when I initialize the start of the plugin build and create the GUI without coding any of the buttons associated with the GUI the plugin works, but as soon as I ...
prashant's user avatar
3 votes
2 answers
1k views

Exporting selected layouts in ArcGIS Pro

I would like to export selected layouts from an ArcGIS project. The error I keep receiving is AttributeError: ValueObject: Get attribute exportToPDF does not exist Is there something different about ...
Thomas Quintero's user avatar
1 vote
1 answer
139 views

"AttributeError: 'QgsZonalStatistics' object has no attribute 'getFeatures'" when filtering ZonalStatistics result in PyQGIS

I want to calculate zonal stats of a raster using a polygon layer and the filter the ouput as another layer. This is the code I tried: zoneStat = QgsZonalStatistics (tempVectorLyr, rasterLyr, '-', 1) ...
Ahmad Raji's user avatar
3 votes
2 answers
1k views

Converting CRS from EPSG:4326 to EPSG:32635 using PyQGIS

How in QGIS 3.16 to convert from CRS EPSG:4326 to CRS EPSG:32635 using Python? I got this error: exec(open('C:/Users/aaa/AppData/Local/Temp/tmpovpzt0d0.py'.encode('utf-8')).read()) Traceback (most ...
DA53's user avatar
  • 51
5 votes
2 answers
2k views

"AttributeError: 'str' object has no attribute 'dataProvider'" when persisting layer from memory into project

I'm writing some scripts in QGIS 3 to automate processing using a number of the inbuilt algorithms. I'm using memory layers to store the intermediate results of the algorithms. I'm looking for a ...
Danny's user avatar
  • 83
2 votes
1 answer
2k views

AttributeError while Plotting GeoDataFrame

I am new to geopandas. I am trying to plot the locations of bays and gulfs. I have a csv file containing their names. After geocoding and finding their locations, I tried to plot the points on a world ...
Padmanabha's user avatar
  • 1,394
1 vote
1 answer
2k views

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

I'm trying write simple code line in PyQgis in PyCharm, have already set environment in PyCharm and seems to be working fine because I can iterate through f.i fields in vector layer proceed with ...
nomad_gis's user avatar
7 votes
2 answers
365 views

AttributeError when counting entity number using PyQGIS

I'm trying to count the number of entities but each time I have this error: `AttributeError: 'dict' object has no attribute 'featureCount' while I have only one selected layer uri = r"C:\...
patrickblancseau's user avatar
0 votes
1 answer
516 views

Error when installing QAD plugin: Plugin 'qad' could not be loaded due to an error calling its method classFactory()

I am trying to install the QAD plugin and it appears this error: No se pudo cargar el complemento 'qad' debido a un error al llamar a su método classFactory() AttributeError: 'QVariant' object has ...
Magda's user avatar
  • 1
0 votes
1 answer
175 views

Python: Cannot construct empty GeoDataFrame with columns [closed]

My script import geopandas as gp test = gp.GeoDataFrame(columns=['geometry', 'costs']) the error: File "/usr/local/lib/python3.7/dist-packages/geopandas/geodataframe.py", line 89, ...
Leo's user avatar
  • 972
0 votes
1 answer
598 views

Using ArcGIS API for Python and Windows Authentication?

I've been trying to follow the ESRI recommended workflow to log on to Enterprise (using authentication), but it just doesn't want to work. I'm able to get the account credentials registered in ...
John Johnson's user avatar
0 votes
0 answers
172 views

AttributeError: Object: Tool or environment <TrainSupportVectorMachineClassifier> not found

I am new to coding and do not know what I am getting the error message: AttributeError: Object: Tool or environment not found. My first line of code is the typical "import arcpy....." I ...
Grace's user avatar
  • 57
4 votes
2 answers
1k views

AttributeError: 'Layer' object has no attribute 'metadata' from ArcPy with ArcGIS Pro [closed]

I am trying to get the metadata for each layer within each map within a ArcGIS Pro project (.aprx file), but get this error message: AttributeError: 'Layer' object has no attribute 'metadata'. The ...
PacmanKX's user avatar
  • 333
3 votes
1 answer
442 views

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

I just started using gdal. I'm trying to get longitude and latitudes from pictures. This is what I have so far. This gives me an attribute error. Anyone know how to fix the attribute error? from ...
shibbyhunt's user avatar
2 votes
1 answer
134 views

Shapefile type description showing attribute error

import arcpy esc = arcpy.Describe("C:\Users\Drona_Maps\Desktop\lecture16\shapefiles\world_continents.shp") print esc.ShapeType Shape file type description showing attribute error like this: ...
soumik chakraborty's user avatar
1 vote
0 answers
398 views

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

Using: QGIS 2.18 with a plugin: ECOPLAN Scenario evaluator, inserting self-made shapefiles made in Arcmap. Received this error: Traceback (most recent call last): File "C:/Users/PAU-...
Anna Loveniers's user avatar
0 votes
1 answer
566 views

RQGIS3 : AttributeError: module '__main__' has no attribute 'RQGIS3'

I am trying to use the RQGIS3 package to access QGIS3 functions from R, and although briefly I had things working (mostly), running the following code: library(RQGIS3) qgis_env <- set_env("C:/...
Glenn Stauffer's user avatar
2 votes
0 answers
115 views

Using QGIS plugin default code produces attribute error

Using Windows 10/QGIS 2.18 and QT Designer, I am creating a plugin that will create several random point selections and to place the results by appending several point layers. So I created a "...
Clutch's user avatar
  • 193