Linked Questions

1
vote
0answers
814 views

Using PyQGiS in custom application gives import qgis.core error [duplicate]

I'm using windows 7 and/or 8 64 bit with QGiS 2.01. I'm wanting to us the pyQGiS tools in a custom python application outside of the QGiS environment (i.e by running a python executable located in C:/...
17
votes
3answers
4k views

Import error for qgis.core when running OSGeo4w shell script

I've been trying, along with this post, to run a script in OSGeo4w Shell, outside of QGIS. But I get the following error: ImportError: No module named qgis.core I have also read the following ...
11
votes
4answers
8k views

Save Print/Map QGIS composer view as PNG/PDF using Python (without changing anything in visible layout)?

I have a QGIS composer/print view opened with all elements adjusted as I wish. Now I need to print/save/export this as a PNG or PDF file from Python console/Python script. I do not want to change ...
17
votes
1answer
13k views

Writing standalone Python scripts using PyQGIS?

I've been learning how to use the Python Console in QGIS using references from qgisworkshop.org. I'm familiar with writing standalone scripts in ArcGIS and want to learn how to do the same with QGIS. ...
6
votes
4answers
17k views

Fixing “ImportError: No module named qgis.core”?

First of all, I'm using Python 2.7.3, QGIS 1.8 (Lisboa) on Windows 7 pro 64 bits. Now let's go to the actual question: I have written some code (Python) that works well within the QGIS built in ...
9
votes
3answers
827 views

Creating large amount of random points in binary raster?

I want to create a point vector dataset of 10000 points (or larger) within a binary raster, where the points should be constrained to areas where the raster value is 1. I tried the following steps. ...
5
votes
1answer
2k views

Importing paths for QGIS 3 standalone scripts

For QGIS 2.x, I used the batch file provided in the answer for this post in the OSGeo4W Shell to run standalone scripts: Problem with import qgis.core when writing a stand-alone PyQGIS script The ...
4
votes
3answers
3k views

No Module named qgis

I installed QGIS through OSGeo4W, and I am trying to write a standalone PyQGIS script, however, I am unable to import the qgis, qgis.core, processing ect… modules, as shown in the picture, I get the ‘...
5
votes
2answers
3k views

How to add a shapefile programatically using PyQGIS

I am trying to add a Shapefile outside of the QGIS environment using PyQGIS. Ideally this would be done without creating a map in QGIS. I've started with the code below but am receiving the following ...
5
votes
1answer
3k views

Executing a standalone QGIS python script on Windows 10

In Windows 10, I currently have two working scripts (.BAT and .PY) which are used to generate PDFs from QGIS based on the solution here. My goal is to be able to execute the python script without ...
5
votes
1answer
2k views

Running processing toolbox outside QGIS in standalone app?

I am developing a standalone app in Python, using QGIS libraries including processing algorithms. I am developing in Linux environment and I put the libraries in a folder. Also I put the processing ...
3
votes
1answer
5k views

Running Python outside of QGIS - (ImportError: No module named qgis.core)

I'm trying to run simple scripts on QGIS from outside the QGIS environment - as here How to run a simple python script for QGIS from outside (e.g. Sublime Text)? My code: import sys sys.path.append(...
7
votes
1answer
2k views

Getting QGIS python modules to work from PyScripter in Windows 10?

Been trying lots of "solutions" from net research but nothing seems to work. I have the current versions of QGIS from OSGEO and PyScripter 2.5 Based on one of the solutions I tried... import sys ...
7
votes
1answer
1k views

Efficiently generate Voronoi layers in qgis via Python

The following python commands both appear to function when called in qgis 2.6 to generate Voronoi diagrams: processing.runalg("qgis:voronoipolygons", pointLayer, 1, None) processing.runalg("grass:v....
4
votes
1answer
2k views

import qgis.core problem with QgsFeature and QgsGeometry ImportError: DLL load failed: The specified procedure could not be found [closed]

I've tried several previous answers to similar questions - no luck. I've tried everything, nothing seems to work. This is the error I'm getting: Traceback (most recent call last): File "D:\Projects\...

15 30 50 per page