I'm wondering if anybody has experience in installing external software for QGIS plugins. I am developing one and I feel like I have hit a wall. I need to use osm2pgrouting, but it is written in C and needs to be compiled on the client's computer in order to be used properly.

I am experimenting with subprocesses like so:

import subprocess
import os


params1 = ["cmake", "-H.", "-Bbuild"]
params3 = ["make"]
params4 = ["make", "install"]

subprocess1 = subprocess.Popen(params1, stdout=subprocess.PIPE)
subprocess3 = subprocess.Popen(params3, stdout=subprocess.PIPE)
subprocess4 = subprocess.Popen(params4, stdout=subprocess.PIPE)

But it is failing and I believe that it is because root privileges are required in order to install this software. I would like to include a "first time setup" function to compile and install it so that the user doesn't have to bother, but I'm wondering if this is even possible.

Is there a smarter way of going about this or am I just stuck instructing the user to install osm2pgrouting themselves manually before using the plugin?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.