Skip to content

Commit 6c3fa81

Browse files
authored
Use same interpreter as used by jupyter when checking pandas (#8228)
1 parent e005d5f commit 6c3fa81

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

news/2 Fixes/8084.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When checking the version of `pandas`, use the same interpreter used to start `Jupyter`.

src/client/datascience/data-viewing/dataViewerProvider.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import { IPythonExecutionFactory } from '../../common/process/types';
99
import { IAsyncDisposable, IAsyncDisposableRegistry } from '../../common/types';
1010
import * as localize from '../../common/utils/localize';
1111
import { noop } from '../../common/utils/misc';
12-
import { IInterpreterService } from '../../interpreter/contracts';
1312
import { IServiceContainer } from '../../ioc/types';
14-
import { IDataViewer, IDataViewerProvider, IJupyterVariables, INotebook } from '../types';
13+
import { IDataViewer, IDataViewerProvider, IJupyterExecution, IJupyterVariables, INotebook } from '../types';
1514

1615
@injectable()
1716
export class DataViewerProvider implements IDataViewerProvider, IAsyncDisposable {
@@ -21,7 +20,7 @@ export class DataViewerProvider implements IDataViewerProvider, IAsyncDisposable
2120
@inject(IAsyncDisposableRegistry) asyncRegistry: IAsyncDisposableRegistry,
2221
@inject(IJupyterVariables) private variables: IJupyterVariables,
2322
@inject(IPythonExecutionFactory) private pythonFactory: IPythonExecutionFactory,
24-
@inject(IInterpreterService) private interpreterService: IInterpreterService
23+
@inject(IJupyterExecution) private readonly jupyterExecution: IJupyterExecution
2524
) {
2625
asyncRegistry.push(this);
2726
}
@@ -45,7 +44,7 @@ export class DataViewerProvider implements IDataViewerProvider, IAsyncDisposable
4544
}
4645

4746
public async getPandasVersion(): Promise<{ major: number; minor: number; build: number } | undefined> {
48-
const interpreter = await this.interpreterService.getActiveInterpreter();
47+
const interpreter = await this.jupyterExecution.getUsableJupyterPython();
4948
const launcher = await this.pythonFactory.createActivatedEnvironment({ resource: undefined, interpreter, allowEnvironmentFetchExceptions: true });
5049
try {
5150
const result = await launcher.exec(['-c', 'import pandas;print(pandas.__version__)'], { throwOnStdErr: true });

0 commit comments

Comments
 (0)