Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/6802.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix miniconda environments to work.
61 changes: 33 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion src/client/interpreter/locators/services/condaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,21 @@ export class CondaService implements ICondaService {
try {
const condaFile = await this.getCondaFile();
const processService = await this.processServiceFactory.create();
const envInfo = await processService.exec(condaFile, ['env', 'list']).then(output => output.stdout);
let envInfo = await processService.exec(condaFile, ['env', 'list']).then(output => output.stdout);
traceVerbose(`Conda Env List ${envInfo}}`);
if (!envInfo) {
traceVerbose('Conda env list failure, attempting path additions.');
// Try adding different folders to the path. Miniconda fails to run
// without them.
const baseFolder = path.dirname(path.dirname(condaFile));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can we add some logging using traceVerbose to log the new path value with some more comments.
This way we know it is going down this route, useful when troubleshooting...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure no problem.

const binFolder = path.join(baseFolder, 'bin');
const condaBinFolder = path.join(baseFolder, 'condabin');
const libaryBinFolder = path.join(baseFolder, 'library', 'bin');
const newEnv = process.env;
newEnv.PATH = `${binFolder};${condaBinFolder};${libaryBinFolder};${newEnv.PATH}`;
traceVerbose(`Attempting new path for conda env list: ${newEnv.PATH}`);
envInfo = await processService.exec(condaFile, ['env', 'list'], { env: newEnv }).then(output => output.stdout);
}
const environments = this.condaHelper.parseCondaEnvironmentNames(envInfo);
await globalPersistence.updateValue({ data: environments });
return environments;
Expand Down