diff --git a/a00_qpip/plugin.py b/a00_qpip/plugin.py index f57c287..8b9534c 100644 --- a/a00_qpip/plugin.py +++ b/a00_qpip/plugin.py @@ -276,12 +276,20 @@ def check(self): self.save_settings(dialog) def show_folder(self): - if platform.system() == "Windows": - os.startfile(self.prefix_path) - elif platform.system() == "Darwin": - subprocess.Popen(["open", self.prefix_path]) + if os.path.isdir(self.prefix_path): + if platform.system() == "Windows": + os.startfile(self.prefix_path) + elif platform.system() == "Darwin": + subprocess.Popen(["open", self.prefix_path]) + else: + subprocess.Popen(["xdg-open", self.prefix_path]) else: - subprocess.Popen(["xdg-open", self.prefix_path]) + self.iface.messageBar().pushMessage( + "QPIP", + f"The folder {self.prefix_path} has not yet been created. It will be created when dependencies are installed.", + level=Qgis.Info, + duration=5 + ) def _check_on_startup(self): return self.settings.value("check_on_startup", "no") == "yes"