From 2f3d490d52aa3b87a3b6f9c28235b94e9d5d23da Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 28 Jun 2023 17:36:31 -0700 Subject: fixes --- extension/src/activation/environmentSetup.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'extension/src/activation/environmentSetup.ts') diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 6ea60195..4e6227c7 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -101,26 +101,28 @@ function checkEnvExists() { } function checkRequirementsInstalled() { - const envLibsPath = path.join( + let envLibsPath = path.join( getExtensionUri().fsPath, "scripts", "env", process.platform == "win32" ? "Lib" : "lib" ); - // Get the python version folder name - const pythonVersions = fs.readdirSync(envLibsPath).filter((f: string) => { - return f.startsWith("python"); - }); - if (pythonVersions.length == 0) { - return false; + // If site-packages is directly under env, use that + if (fs.existsSync(path.join(envLibsPath, "site-packages"))) { + envLibsPath = path.join(envLibsPath, "site-packages"); + } else { + // Get the python version folder name + const pythonVersions = fs.readdirSync(envLibsPath).filter((f: string) => { + return f.startsWith("python"); + }); + if (pythonVersions.length == 0) { + return false; + } + const pythonVersion = pythonVersions[0]; + envLibsPath = path.join(envLibsPath, pythonVersion, "site-packages"); } - const continuePath = path.join( - envLibsPath, - pythonVersions[0], - "site-packages", - "continuedev" - ); + const continuePath = path.join(envLibsPath, "continuedev"); return fs.existsSync(continuePath); -- cgit v1.2.3-70-g09d2