diff --git a/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java b/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java index 95f6ef828fee..1c195fbd205a 100644 --- a/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java +++ b/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java @@ -74,7 +74,7 @@ public class PyCondaPackageManagerImpl extends PyPackageManagerImpl { } private ProcessOutput getCondaOutput(@NotNull final String command, List arguments) throws ExecutionException { - final String condaExecutable = PyCondaPackageService.getCondaExecutable(); + final String condaExecutable = PyCondaPackageService.getCondaExecutable(mySdk.getHomeDirectory()); if (condaExecutable == null) throw new PyExecutionException("Cannot find conda", "Conda", Collections.emptyList(), new ProcessOutput()); final String path = getCondaDirectory(); @@ -166,14 +166,14 @@ public class PyCondaPackageManagerImpl extends PyPackageManagerImpl { final String condaName = "conda-meta"; final VirtualFile homeDirectory = sdk.getHomeDirectory(); if (homeDirectory == null) return false; - final VirtualFile condaExecutable = SystemInfo.isWindows ? homeDirectory.getParent().findChild(condaName) : + final VirtualFile condaMeta = SystemInfo.isWindows ? homeDirectory.getParent().findChild(condaName) : homeDirectory.getParent().getParent().findChild(condaName); - return condaExecutable != null; + return condaMeta != null; } @NotNull public static String createVirtualEnv(@NotNull String destinationDir, String version) throws ExecutionException { - final String condaExecutable = PyCondaPackageService.getCondaExecutable(); + final String condaExecutable = PyCondaPackageService.getSystemCondaExecutable(); if (condaExecutable == null) throw new PyExecutionException("Cannot find conda", "Conda", Collections.emptyList(), new ProcessOutput()); final ArrayList parameters = Lists.newArrayList(condaExecutable, "create", "-p", destinationDir, diff --git a/python/src/com/jetbrains/python/packaging/PyCondaPackageService.java b/python/src/com/jetbrains/python/packaging/PyCondaPackageService.java index fe42dab4df77..6b1b685efcd9 100644 --- a/python/src/com/jetbrains/python/packaging/PyCondaPackageService.java +++ b/python/src/com/jetbrains/python/packaging/PyCondaPackageService.java @@ -92,7 +92,7 @@ public class PyCondaPackageService implements PersistentStateComponent parameters = Lists.newArrayList(conda, "config", "--add", "channels", repositoryUrl, "--force"); final GeneralCommandLine commandLine = new GeneralCommandLine(parameters); @@ -91,7 +91,7 @@ public class PyCondaManagementService extends PyPackageManagementService { @Override public void removeRepository(String repositoryUrl) { - final String conda = PyCondaPackageService.getCondaExecutable(); + final String conda = PyCondaPackageService.getCondaExecutable(mySdk.getHomeDirectory()); final ArrayList parameters = Lists.newArrayList(conda, "config", "--remove", "channels", repositoryUrl, "--force"); final GeneralCommandLine commandLine = new GeneralCommandLine(parameters); diff --git a/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java b/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java index 1bd3e2a38de7..4e829eea9767 100644 --- a/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java +++ b/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java @@ -47,7 +47,7 @@ public class PyPackageManagementService extends PackageManagementService { @NotNull private static final Pattern PATTERN_ERROR_LINE = Pattern.compile(".*error:.*", Pattern.CASE_INSENSITIVE); private final Project myProject; - private final Sdk mySdk; + protected final Sdk mySdk; public PyPackageManagementService(@NotNull final Project project, @NotNull final Sdk sdk) { myProject = project; diff --git a/python/src/com/jetbrains/python/sdk/CreateCondaEnvDialog.java b/python/src/com/jetbrains/python/sdk/CreateCondaEnvDialog.java index 5611ba429f61..7e88d1414ee0 100644 --- a/python/src/com/jetbrains/python/sdk/CreateCondaEnvDialog.java +++ b/python/src/com/jetbrains/python/sdk/CreateCondaEnvDialog.java @@ -68,7 +68,7 @@ public class CreateCondaEnvDialog extends AbstractCreateVirtualEnvDialog { return; } else { - final String conda = PyCondaPackageService.getCondaExecutable(); + final String conda = PyCondaPackageService.getSystemCondaExecutable(); if (conda != null) { final VirtualFile condaFile = LocalFileSystem.getInstance().findFileByPath(conda); if (condaFile != null) { diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java b/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java index cd63349d2df6..453ab6a311d1 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java @@ -106,7 +106,7 @@ public class PythonSdkDetailsStep extends BaseListPopupStep { options.add(REMOTE); } options.add(VIRTUALENV); - if (PyCondaPackageService.getCondaExecutable() != null) { + if (PyCondaPackageService.getSystemCondaExecutable() != null) { options.add(CONDA); }