Skip to content

Commit 239ce44

Browse files
committed
update for parent-parent
1 parent 23be12b commit 239ce44

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/managers/builtin/venvManager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ export class VenvManager implements EnvironmentManager {
191191
try {
192192
const stat = await fs.stat(envPath.fsPath);
193193
if (!stat.isDirectory()) {
194-
// If the env path is a file (likely the python binary), use its parent directory
195-
envPath = Uri.file(path.dirname(envPath.fsPath));
194+
// If the env path is a file (likely the python binary), use parent-parent as the env path
195+
// following format of .venv/bin/python or .venv\Scripts\python.exe
196+
envPath = Uri.file(path.dirname(path.dirname(envPath.fsPath)));
196197
}
197198
} catch (err) {
198199
// If stat fails, fallback to original envPath

0 commit comments

Comments
 (0)