eric7/Plugins/PluginEricapi.py

branch
eric7
changeset 9138
85f68ca14a7a
parent 8881
54e42bc2437a
diff -r 3472875532c0 -r 85f68ca14a7a eric7/Plugins/PluginEricapi.py
--- a/eric7/Plugins/PluginEricapi.py	Mon Jun 06 16:32:04 2022 +0200
+++ b/eric7/Plugins/PluginEricapi.py	Mon Jun 06 17:44:51 2022 +0200
@@ -8,6 +8,7 @@
 """
 
 import os
+import sys
 
 from PyQt6.QtCore import QObject, QCoreApplication
 from PyQt6.QtWidgets import QDialog
@@ -50,11 +51,28 @@
     """
     exe = 'eric7_api'
     if Utilities.isWindowsPlatform():
-        exe = os.path.join(getConfig("bindir"), exe + '.cmd')
-        if not os.path.exists(exe):
-            exe = os.path.join(getConfig("bindir"), exe + '.bat')
+        for exepath in (
+            getConfig("bindir"),
+            os.path.join(sys.exec_prefix, "Scripts"),
+        ):
+            found = False
+            for ext in (".exe", ".cmd", ".bat"):
+                exe_ = os.path.join(exepath, exe + ext)
+                if os.path.exists(exe_):
+                    exe = exe_
+                    found = True
+                    break
+            if found:
+                break
     else:
-        exe = os.path.join(getConfig("bindir"), exe)
+        for exepath in (
+            getConfig("bindir"),
+            os.path.join(sys.exec_prefix, "bin"),
+        ):
+            exe_ = os.path.join(exepath, exe)
+            if os.path.exists(exe_):
+                exe = exe_
+                break
     
     data = {
         "programEntry": True,

eric ide

mercurial