Skip to content

Commit b90d84a

Browse files
committed
CondaInstaller: Separate path for conda on windows
1 parent 7c78171 commit b90d84a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Orange/canvas/application/addons.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,24 @@ def manual_uninstall(self, dist):
861861

862862
class CondaInstaller:
863863
def __init__(self):
864+
self.conda = self._find_conda()
865+
866+
def _find_conda(self):
864867
executable = sys.executable
865868
bin = os.path.dirname(executable)
869+
870+
# posix
866871
conda = os.path.join(bin, "conda")
867-
self.conda = conda if os.path.exists(conda) else None
872+
if os.path.exists(conda):
873+
return conda
874+
875+
# windows
876+
conda = os.path.join(bin, "Scripts", "conda.bat")
877+
if os.path.exists(conda):
878+
# "activate" conda environment orange is running in
879+
os.environ["CONDA_PREFIX"] = bin
880+
os.environ["CONDA_DEFAULT_ENV"] = bin
881+
return conda
868882

869883
def install(self, pkg):
870884
cmd = ["conda", "install", "--yes", pkg.name]

0 commit comments

Comments
 (0)