diff --git a/__init__.py b/__init__.py index 07f6ac4..b4c0bb2 100644 --- a/__init__.py +++ b/__init__.py @@ -48,6 +48,7 @@ def __init__(self, iface): import debugpy self.debugpy = debugpy + self.debugpy.configure(python=get_qgis_python_path()) except: pass self.port = 5678 @@ -160,3 +161,13 @@ def run(self, checked): self.debugpy.wait_for_client() exec(open(filename).read()) + +def get_qgis_python_path(): + if sys.platform.startswith("linux"): + return sys.executable + pythonExec = os.path.dirname(sys.executable) + if sys.platform == "win32": + pythonExec += "\\python3" + else: + pythonExec += "/bin/python3" + return pythonExec