I cannot get to open my Python scripts saved in default directory: ....\QGIS\QGIS3\profiles\default\processing\scripts in QGIS 3.0 Processing Toolbox. There is no folder called Scripts like in 2.18.  Anybody knows how to open my Python script in Processing Toolbox of 3.0?
27329
A simple script created within the QGIS 2.18 processing toolbox:  ##example=string print example   Upon running would produce and input box in a window with a run button:   Once executed would produce the expected print in the python console  When testing the same code in QGIS-3.0, changing the print to python 3's print(), I get an error where the input section is seemingly ignored as a comment:   Does the processing framework no longer accept inputs in this way?
11658
Python is installed in a local directory.    My directory tree looks like this:  (local directory)/site-packages/toolkit/interface.py   My code is in here:  (local directory)/site-packages/toolkit/examples/mountain.py   To run the example, I write python mountain.py, and in the code I have:  from toolkit.interface import interface   And I get the error:  Traceback (most recent call last):   File "mountain.py", line 28, in ?     from toolkit.interface import interface ImportError: No module named toolkit.interface   I have already checked sys.path and there I have the directory /site-packages. Also, I have the file __init__.py.bin in the toolkit folder to indicate to Python that this is a package. I also have a __init__.py.bin in the examples directory.  I do not know why Python cannot find the file when it is in sys.path.  Any ideas?  Can it be a permissions problem?  Do I need some execution permission?
54770
I have a problem with LAStools in QGIS 2.14. I've followed the LAStools instructions for downloading LAStools for QGIS. `  I replaced 'lidar' folder in C:\OSGeo4W64\apps\qgis\python\plugins\processing\algs\lidar with the folder downloaded from .  I downloaded the 'LAStools' folder and put it in the following location: 'C:\LAStools'. I activate LAStools in to Processing, and type 'C:\LAStools' for the 'LAStools folder location', but I get the following message:      "Wrong value for parameter "OTB applications folder":   Specified path does not exist:   C:/OSGEO4~1/apps\orfeotoolbox\applications"   LAStools appears in the processing toolbox. I can start to run a lasview. The data appears in 'just a little LAS and LAZ viewer', but the program hangs and then crashes.  Is this happening because of the error message? I have looked through the StackExchange for other examples of this specific problem, with no success. Any suggestions on what am I doing wrong?
2071
I'm writing a script which must work outside of QGIS GUI. I call some API functions from qgis.core but I'd like to use the processing plugin.  I'm able to import processing with sys.path.append() but I can't run any process. Moreover, all "native" algs are missing in QgsApplication.processingRegistry().algorithms()  So is it possible to run processing that way ? What am I missing ?  import os, sys from qgis.core import * QgsApplication.setPrefixPath('/usr', True) qgs = QgsApplication([], False) qgs.initQgis()  sys.path.append('/usr/share/qgis/python/plugins') from processing.core.Processing import Processing Processing.initialize() import processing  layer1 = QgsVectorLayer('data/ROUTE_PRIMAIRE.SHP') layer2 = QgsVectorLayer('data/ROUTE_SECONDAIRE.SHP')  processing.run('qgis:union', layer1, layer2, 'test.shp') # returns nothing   I'm on QGIS 3.0.1 - Debian 9
100879
I've looked at some answers on here about deleting shapefiles with QGIS but I still seem to be running into errors. I am trying to delete shapefiles that have no attribute data in them (so 0 rows). My main issue is that I get:  PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:  I have tried using QgsVectorFileWriter.deleteShapeFile(f) but that leaves the .shp and .dbf behind.   I have also tried using os.remove for each individual file extension and that gives me the Win Error 32.   It seems like my files are still being used in QGIS. Does anyone know how to work around it?   Here is my full script:  clipped_soilpoly = get_data(clipped_folder, ".shp") # makes a list of all the .shps for f in clipped_soilpoly:     shapelayer = QgsVectorLayer(f,"clipped_poly")     rowcount = shapelayer.featureCount()`  if rowcount &lt; 1:               print ("deleting " + f + " - does not intersect")          #QgsVectorFileWriter.deleteShapeFile(f) &lt;-- only deleting some of the file extensions              split_path = os.path.splitext(f)[0]             del f          #delete .shp             shp = split_path + ".shp"             os.remove(shp)          #delete .dbf                 dbf = split_path + ".dbf"             os.remove(dbf)          #delete .prj                 prj = split_path + ".prj"             os.remove(prj)          #delete .qpj                 qpj = split_path + ".qpj"             os.remove(qpj)          #delete .shx                shx = split_path + ".shx"             os.remove(shx)           else:             print ("keeping " + f)
11318
Is there a way to access QGIS plugins in Python?   I'd like to write a script to do some geoprocessing, and I'd like to use the clip, regular points and convex hull tools in fTools, as well as the Road graph plugin. The latter is probably a different can of worms because it is a C++ rather than Python plugin.
79101
I have some Python code that makes Raster Attribute Tables for GeoTiffs using GDAL.    In ArcGIS I can see these attribute tables fine and they behave how I like (as classifications) but in QGIS the whole concept of an attribute table seems to be missing.    Is there any way to access a RAT in QGIS?
64012
I have a Python script which I would like to execute at every startup. I can run it by adding this to the startup applications:  python3 /path/to/script.py   That works, but it doesn't open a terminal window, so I can't see the program's output. How could I make it open a terminal window and execute the script in there?  Note: I get the window to stay open with input(' ') at the end of the Python script. Thanks!
167
I installed QGIS 3.0.0 on a PC with French as default language. After changing the language of QGIS to English, the 'Vector' menu is empty and there is a French 'Vecteur' menu. Any ideas how to fix this? I cannot change the system language.
101239
We have a preferences option to enable auto-run of python scripts when opening blend files. We can also add paths that are excluded from auto-running scripts. Then we have a cli options to enable or disable auto-running scripts and to bypass the startup.blend with --factory-startup.  In regard to auto-running scripts which of these options overrides all others?  If my startup.blend disables auto-run, can a python script be run from the cli to enable auto-run for the blend being opened?  Does --factory-startup bypass my auto-run settings?
83763
Inspired by , but for QGIS 3 (and therefore Python 3), I would like to use the QGIS processing algorithms in a standalone Python script without a GUI, with a standard installation of Ubuntu Linux. A simple import processing is insufficient: import processing processing.run(    &quot;qgis:rasterlayerstatistics&quot;,    {        'INPUT': .'/somefile.tif',        'BAND': 1,        'OUTPUT_HTML_FILE': './result.html'    } )  Results in: Traceback (most recent call last):   File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; ModuleNotFoundError: No module named 'processing'  How do you get access to the QGIS processing module to use the QGIS processing algorithms in a standalone Python script (not the QGIS interpreter)?
53819
What's the best way to get the full directory of the current Blender file in Python?  It should be cross-platform.
52190
How to install and how to compile networkx python on QGIS?  I always get an error that no module named networkx in the console of QGIS I copied the file networkx in C:\Program Files\Quantum GIS Lisboa\apps\Python27\Lib\site-packages and there are not change.
9568
I'm looking for some examples to do simple python scripts in QGIS. How would I do a buffer analysis on a dataset? I can't seem to find much in the manual and QGIS python that quite matches the ESRI documentation.
62100
Making some tests in Windows XP for customizing a user interface in QGIS 1.8 (see ), I have unchecked, among other options, the Settings Menu. This means that, after restarting QGIS, there's no way of recovering the older settings because there is not already a Setting Menu. So, I cannot reload any ini file.  For your information, as a precaution, previously I have saved in a folder both the original ini file, with all the options, and the customized ini file with only some options (of course, not included here the necessary Settings Menu).  Before reinstalling QGIS (version 1,8), I would like to try other smarter options if there's any. Where and what does QGIS look at where this applications starts?
94251
I'm new to postgreSQL and I have a simple question:  I'm trying to create a simple script that creates a DB so I can later call it like this:  psql -f createDB.sql   I want the script to call other scripts (separate ones for creating tables, adding constraints, functions etc), like this:  \i script1.sql \i script2.sql   It works fine provided that createDB.sql is in the same dir.  But if I move script2 to a directory under the one with createDB, and modify the createDB so it looks like this:  \i script1.sql \i somedir\script2.sql   I get an error:     psql:createDB.sql:2: somedir: Permission denied   I'm using Postgres Plus 8.3 for windows, default postgres user.  EDIT:  Silly me, unix slashes solved the problem.
18253
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 Python console, but now I need to run it from outside QGIS (it is too much to ask for the final user to open QGIS, then the python console and to copy and paste the code).  I have been trying to access the QGIS API, but it is missing from my PYTHONPATH. I've tried whatever is on the instructions, plus a bunch of paths like:  C:\Program Files(x86)\QGIS\apps\qgis\python\qgis and  C:\Program Files(x86)\QGIS\apps\qgis\python. My result so far is always the same:  import qgis.core ImportError: No module named qgis.core   Any ideas?