Skip to content

Jupyter auto-install should detect conda vs pip rather than asking the user. #3275

@greazer

Description

@greazer

An update to issue microsoft/vscode-python#5682. When auto installing jupyter we shouldn't ask whether they are installing to a conda or pip environment. We should detect whether it's conda (or since you guys are already part of the extension, maybe you can rely on internal information about the loaded interpreters).

Here's how the python extension detects whether a particular python installation is conda.
/**
* Determines whether a python interpreter is a conda environment or not.
* The check is done by simply looking for the 'conda-meta' directory.
* @param {string} interpreterPath
* @returns {Promise}
* @memberof CondaService
*/
public async isCondaEnvironment(interpreterPath: string): Promise {
const dir = path.dirname(interpreterPath);
const isWindows = this.platform.isWindows;
const condaMetaDirectory = isWindows ? path.join(dir, 'conda-meta') : path.join(dir, '..', 'conda-meta');
return this.fileSystem.directoryExists(condaMetaDirectory);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions