Questions tagged [python-3]

Use this tag when Python 3 (or any of its dot releases) is the version you are using.

Filter by
Sorted by
Tagged with
17
votes
3answers
9k views

OSGeo4W shell with python3

I would like to use OSGeo4W shell with Python3 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\...
13
votes
4answers
13k views

Will ArcGIS Desktop support latest Python 2.x or Python 3.x versions?

I'm curious to know whether ArcGIS Desktop 10.0 will support newer versions of Python than 2.6. And for that matter newer versions of NumPy (ie, 1.4, 1.5 etc). I'm sure that this documentation is on ...
10
votes
2answers
6k views

Using Python 3.x in ArcGIS?

I've been reading the "Whats New in ArcGIS" for the ArcGIS 10.3 update and came across the Python and ArcPy portion. It states that: ArcGIS 10.3 has been upgraded to include Python 2.7.8. Now ...
9
votes
3answers
3k views

Distinguishing Python version when using IDLE with ArcGIS Pro and ArcGIS 10.x for Desktop architecture?

I have just started to work with Python 3.4.1 which comes with ArcGIS Pro 1.0.0, on my laptop, which also has Python 2.7.8 which comes with ArcGIS 10.3 for Desktop installed, and I would like to ...
8
votes
3answers
8k views

Where can I find GDAL Python bindings for Python 3.4?

I am using python 3.4 for development and I need GDAL python bindings for python 3.4. I have already gone through this site, but I can only find up to python 3.3?
7
votes
3answers
6k views

Installing external python packages for QGIS 3?

While there are tools and methods for qgis 2 i cannot figure out for 3 I want to install external python packages such as sqlalchemy etc I tried the following things : Tried to download osgeo4w ...
6
votes
4answers
15k views

Is there Python 3 module to read .dbf files written by ArcGIS for Desktop?

I would like to know whether there are Python 3.x-compatible (preferably Python 3.3) modules to read the kind of .dbf files produced by ArcGIS for Desktop. All the modules I found were only ...
6
votes
2answers
4k views

Python 3 support in QGIS?

As python3 is getting standard more and more I wonder wether there is or will be support for python 3 in QGIS?
6
votes
1answer
324 views

Explaining pyproj to_epsg min_confidence parameter?

Following on from this question How can I get epsg code in pyproj with version==2.1.3, I discovered that sometimes when intialising a pyproj Proj instance with a string ESPG code eventually results in ...
5
votes
2answers
3k views

Starting Python Shell Window of IDLE for use with ArcGIS Pro?

Prior to installing ArcGIS Pro 1.3 (I am now at 1.3.1), on Windows 7 SP1, I have been starting IDLE in a Python Shell Window from the Windows Start Menu using IDLE (Python GUI) in the Python 3.4 ...
5
votes
2answers
1k views

Python 3 with QGIS on Mac?

I need to start learning Python, and I want to learn with version 3.x. I understand that QGIS--at least some plug-ins--relies on Python and Tcl/Tk, and probably on specific versions. Assuming that ...
5
votes
3answers
6k views

Using PyScripter with ArcGIS for Desktop?

Can someone please let me know how I can set the PyScripter 2.5.3.0 x64 works with Python 2.7.3 which comes with ArcGIS what I did was: I installed the ArcGIS 10.2 I installed PyScripter 2.5.3.0 x64 ...
5
votes
2answers
276 views

MessageLevel in QGIS3

I am trying to migrate a plugin to QGIS3 from QGIS2 and I am having issues with an API. The original python has QgsMessageBar.MessageLevel but https://qgis.org/api/api_break.html says it has been ...
5
votes
4answers
7k views

How to (re)install gdal in python3 (mac)?

I am stuck trying to install gdal, running python3.6 on a Mac. When I run pip install gdal I get errors of Failed building wheel for gdal error: command 'gcc' failed with exit status 1 Command "/...
5
votes
1answer
1k views

Sending arguments to LAStools function from Python script not working

I`m trying to call the lasground module from a python script, using this method: args=['lasground', '-i *.las', output_file, arg_step, arg_spike, arg_spikedown, arg_offset, arg_bulge, arg_cores] proc=...
5
votes
1answer
2k views

pyQGIS returns invalid layer with QgsVectorLayer in QGIS 3

I have the following problem : I've installed all pyQGIS environment on Windows 7. I work with 64 bits version of Python 3.6 and QGIS 3.0 and PyQt5. My Windows paths are ok. My objective is to create ...
5
votes
1answer
1k views

Getting log error about default locale settings when using GRASS with QGIS?

I downloaded python 3.6, installed it, dowloaded QGIS 3.0.2, installed GDAL, then QGIS, then opened QGIS and tried to use GRASS processing tools. Initially I got the following error: env: python3: No ...
5
votes
1answer
272 views

Make ST_Polygonize in Postgis return dangles, cuts and invalid rings

Postgis allows using ST_Polygonize() from GEOS to make polygons out of lines. I have seen the same function available in Shapely library for Python, but in Shapely, the other method named ...
4
votes
1answer
120 views

Why does osr.SpatialReference return different values in python2 and 3?

Can somebody explain why the result of osr.SpatialReference() differ between Python 2 and 3? sr = osr.SpatialReference() sr.SetFromUserInput('EPSG:28992') sr.ExportToProj4() In Python 2.7 this gives ...
4
votes
1answer
206 views

Differences between OSGEO GDAL and GDAL python bindings?

Question I'm trying to figure what are the differences, and of course, what is the best solution to use, between two python3 bindings: GDAL, imported as import gdal OSGEO.GDAL, imported as ...
4
votes
2answers
592 views

Bug using Python 3.7 (from QGIS) and trying to install package with pip

I use QGIS 3.6 and Python 3.7 and I try to install a package with pip in command line tool under Windows 7 but I have the following message : Fatal Python error: initfsencoding: unable to load the ...
4
votes
2answers
14k views

Fill color not showing appropriately in folium?

The following code should have shown different colored circles in a map. But my result was circles with no color at all. import folium import pandas data=pandas.read_csv("Volcanoes.txt") lat = list(...
4
votes
1answer
2k views

Using output statistics in ArcGIS REST API query?

I am using an API to pull in some Web Mapping Service Layer data to my script. The API query has a max count limit of 1000 on returned features per request. There are 2 attributes I am trying to use ...
4
votes
1answer
136 views

Setting a Background Color with RVBT field with python

I'm trying to set the color of a background of a layer. To do this i created an attribute "Color" with the RVBT numbers associate to each feature. As in the picture, i want to set the color with those ...
4
votes
1answer
1k views

How to let ogr/gdal CreateLayer() create a `geom` field instead of `wkb_geometry`?

When creating a new table (PostGIS) using OGR/GDAL (2.1+), is there a way to select a specific name for the geometry field (such as geom), rather than using the default name? I created a new table ...
4
votes
1answer
360 views

Weird schema lock issue

I wrote a Python script that produces several output features layers in separate .gdb's. As I am testing and modifying my code, I generally go into arcCatalog, find the .gdb under which the feature ...
3
votes
1answer
2k views

Getting bounding box from Point type GeoDataFrame to getting data from Osmnx

I've a point geodataframe which has only point features inside of it. fishnet_Id ... geometry 0 0 ... POINT (403486 4540640) 1 ...
3
votes
1answer
127 views

pyqgis create layer from a list of points

I am working with pyqgis in QGIS3 and i want to create a point layer from an intersection beetween a point and a polygon layer. I can identify wich points intersects my polygon layer but i can't use ...
3
votes
1answer
53 views

QGIS 3.8 Python merge files

For a merge operation I need a list of all my layers in the TOC with path and filename. How can I achieve that? layers = QgsProject.instance().mapLayers() # dictionary myLyrList[] for layer in layers....
3
votes
2answers
170 views

Launch QGIS GUI using batch file and Python 3 - Windows 10

Ultimately I'm attempting to launch the QGIS GUI and run a python script from a batch file. I've reviewed numerous instances referencing similar scenarios on this and other forums but for the life of ...
3
votes
1answer
185 views

QGIS development version(2.99) and python api questions

Can I use QGIS 2.99 PyQGIS in standalone apps like the others QGIS version? Do I need python 3.6 to use this python api?
3
votes
1answer
381 views

Merging a geodataframe and pandas dataframe based on a column

I have a simple geopandas dataframe that includes geometry and a column called 'MUKEY': merged_spatial_df.head() I want to merge it to a tabular (.csv) pandas dataframe (which also has a column ...
3
votes
1answer
669 views

Read numerical value of variable in NetCDF4 using Python

I need to undestand how I can get the numerical value of one channel IR_108 ( variable) in NetCDF4 and some other data: import numpy as np from netCDF4 import Dataset path = '/home/data/...
3
votes
1answer
165 views

How to transliterate in QGIS using Python 3

I am QGIS user but beginner in Python. I figured out how to transliterate Georgian script into Latin using this module (https://pypi.org/project/transliterate/). from transliterate import translit, ...
3
votes
1answer
4k views

How to use two different Python versions (3.4 and 2.7) for QGIS scripting?

I´m intending to learn scripting with python in QGIS, but I have a couple of questions. I'm using Python 3.4 for learning which is installed in my laptop, but QGIS is using Python2.7 How could I ...
3
votes
1answer
236 views

Creating a Line feature in PyQGIS QGIS 3.x

In QGIS GUI, a line feature is created from this icon 1.jpg How to Create a line with a fixed distance from a vector layer in python console. This my example: from qgis.core import * from qgis....
3
votes
1answer
930 views

Calculating the Area by Square Feet with Geopandas

I have a geodataframe that has no assigned crs. I want to create a column/field called 'area' that has the area calculated as square feet, not meters or km, using geopandas. Note: this geodataframe ...
3
votes
1answer
267 views

Get xy coordinates of QgsMapCanvas in PyQGIS 3?

I am trying to get the QgsMapCanvas coordinates when they change using PyQt5 and PyQGIS 3. What I have used for that: self.canvas.scaleChanged.connect(lambda: self.showScale(self.canvas.scale())) ...
3
votes
1answer
261 views

Algorithm “qgis:difference” doesn't work in pyQGIS 3

I try to use native algorithm difference of QGIS. But it seams it doesn't work like the others : parameters = {'INPUT': polygons['OUTPUT'], #from temporary layer created before 'OVERLAY'...
3
votes
2answers
366 views

Joining a shapefile attribute table to a CSV file pyqgis3.0

I would like to join a shapefile to a CSV file in PyQGIS 3.0. So, when I run the following code, it executes without errors but the join action does not succeed. What is wrong with the following code? ...
3
votes
1answer
701 views

Decoding this GIS blob

I am new to the decoding world (and even to the world of gis), but I am definitely not new to programming and large data. I was tasked with uncovering a column in our db with this information. It's ...
3
votes
0answers
174 views

OSError - cannot import geopandas

While trying to import geopandas error occurs: Exception has occurred: OSError Could not find lib geos_c.dll or load any of its variants []. I downloaded GDAL and fiona for Python 3.7 from this ...
3
votes
0answers
28 views

Preserving provider of original raster layer when it is modified for another resulting raster layer?

A while ago, I asked for a method to assign new QgsRasterBlock objects to a QgsRasterDataProvider objects at Assign new QgsRasterBlock object to a QgsRasterDataProvider object. The reason was for ...
3
votes
0answers
450 views

Using both QGIS and native processing algorithms in standalone Python script?

I am developing a Python standalone script to process DEM in order to produce slope in vector format. I used PyQt5 to make a GUI to accept input data and parameters from user. My script is like this: ...
3
votes
0answers
297 views

Model in QGIS 3 (.model3) to Python 3? [duplicate]

I try to export a QGIS 3 model (.model3) to Python but the functionality that was available in QGIS 2 doesn't exist anymore. Is there a way to export it ?
3
votes
2answers
476 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:\...
3
votes
0answers
136 views

QGIS Build error : zzz-db_manager-5-depend error - qgis master 2.99

I am compiling QGIS from master in VS 2015 on x64. I am getting error as : Error MSB6006 "cmd.exe" exited with code 1. zzz-db_manager-5-depend 7 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\...
3
votes
0answers
732 views

QGIS 2.99 and python 3.6

I install QGIS 2.99 development version on my windows 10. I see in the installation folder I have folders python27 and python36. I want to ask can i use python 3.6 to take QGIS python API in ...
3
votes
0answers
270 views

Installing Esri FGDB API with GDAL (Python 3.5) [closed]

I've recently migrated to ArcGIS Pro 1.4 and have had no problems moving from Python 2.7 to 3.5 - except one. I try to use gdal/ogr when I can in order to share scripts easily with those who do not ...
3
votes
0answers
5k views

install GDAL 2.0 on Ubuntu 14

I would like to install GDAL==2.0.1 on Ubuntu. A lot of possibilities are found on SO, but none did work for me. I'll give an overview of a selection of my attempts: 1. Using pip directly pip install ...

1
2 3 4 5