I'm writing a python script but, at the moment, I do everything from the Qgis python console. Is there a way to write and run a pyqgis script externally from Qgis?
I'm using Qgis 2.18 and python 2.7.12 on Ubuntu 16.04 OS.
I'm writing a python script but, at the moment, I do everything from the Qgis python console. Is there a way to write and run a pyqgis script externally from Qgis?
I'm using Qgis 2.18 and python 2.7.12 on Ubuntu 16.04 OS.
You may like to try installing and configuring Pycharm. There's an blog article here : How to setup PyCharm for QGIS development (under Debian/Ubuntu) describing how to configure all this.
Download and install anaconda from here https://www.continuum.io/downloads.
open the python shell of anaconda Type this command to install qgis
conda install -c conda-forge qgis
The you can import qgis in python
if the above solution does not workout well for you, try this in your python console.
import sys
sys.path.append("C:\Program Files\QGIS Pisa\apps\Python27\Lib")
import qgis.core
change the qgis path as per your config
import mything; mything.dostuff()from the console is all you need. Write your code as a python module. – Spacedman Aug 31 '17 at 14:59