From b25b737c50fc819d422d776ad25e7221fa18b884 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 28 Jun 2023 17:36:31 -0700 Subject: fixes --- extension/src/activation/activate.ts | 3 ++- extension/src/activation/environmentSetup.ts | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'extension/src') diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index df8b6871..05589d92 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -28,7 +28,8 @@ export async function activateExtension( vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Starting Continue Server...", + title: + "Starting Continue Server... (it may take a minute to download Python packages)", cancellable: false, }, async (progress, token) => { 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