From 7e7e7439a045271a147f58d2bb9d9e4f940e91f4 Mon Sep 17 00:00:00 2001 From: liuzhenghua <1090179900@qq.com> Date: Thu, 25 Jul 2024 11:30:18 +0800 Subject: [PATCH] Update CondaExecutablesLocator.kt The default installation location for conda is the local app data directory --- .../jetbrains/python/packaging/CondaExecutablesLocator.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/python-sdk/src/com/jetbrains/python/packaging/CondaExecutablesLocator.kt b/python/python-sdk/src/com/jetbrains/python/packaging/CondaExecutablesLocator.kt index 3c0fdf2ab51b6..41526237f310b 100644 --- a/python/python-sdk/src/com/jetbrains/python/packaging/CondaExecutablesLocator.kt +++ b/python/python-sdk/src/com/jetbrains/python/packaging/CondaExecutablesLocator.kt @@ -22,6 +22,7 @@ private const val UNIX_CONDA_BIN_DIR_NAME = "bin" private const val PYTHON_EXE_NAME = "python.exe" private const val PYTHON_UNIX_BINARY_NAME = "python" private const val WIN_CONTINUUM_DIR_PATH = "AppData\\Local\\Continuum\\" +private const val WIN_LOCAL_APP_DATA_PATH = "AppData\\Local\\" private const val WIN_PROGRAM_DATA_PATH = "C:\\ProgramData\\" private const val WIN_C_ROOT_PATH = "C:\\" private const val UNIX_OPT_PATH = "/opt/" @@ -84,6 +85,10 @@ private fun getCondaExecutableByName(condaName: String): Path? { if (executableFile != null) return executableFile if (SystemInfo.isWindows) { + condaFolder = userHome / WIN_LOCAL_APP_DATA_PATH / root + executableFile = findExecutable(condaName, condaFolder) + if (executableFile != null) return executableFile + condaFolder = userHome / WIN_CONTINUUM_DIR_PATH / root executableFile = findExecutable(condaName, condaFolder) if (executableFile != null) return executableFile @@ -131,4 +136,4 @@ fun getSystemCondaExecutable(): Path? { LOG.info("System conda executable is not found") return null -} \ No newline at end of file +}