Skip to content

Commit

Permalink
bug(pip): pip in Windows is now called via py
Browse files Browse the repository at this point in the history
Instead of the incorrect `python3`
  • Loading branch information
gnikit committed Feb 5, 2023
1 parent 3a6b8e4 commit 893aa1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Changed the way Python is invoked in Windows machines uses `py` instead of `python`
- Changed the `npm vsce` package to `@vscode/vsce` for publishing
([#814](https://github.com/fortran-lang/vscode-fortran-support/issues/814))
- Changed logger to draw focus on certain error messages
Expand Down
6 changes: 5 additions & 1 deletion src/lib/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as vscode from 'vscode';
import * as assert from 'assert';
import * as cp from 'child_process';
import { isString, isArrayOfString } from './helper';
import { off } from 'process';

export const LS_NAME = 'fortls';
export const EXTENSION_ID = 'fortran';
Expand Down Expand Up @@ -142,7 +143,10 @@ export async function promptForMissingTool(
* @param pyPackage name of python package in PyPi
*/
export async function pipInstall(pyPackage: string): Promise<string> {
const py = 'python3'; // Fetches the top-most python in the Shell
let py = 'python3'; // Fetches the top-most python in the Shell
// For Windows, use py instead of python3, see:
// https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-from-pypi
if (process.platform === 'win32') py = 'py';
const args = ['-m', 'pip', 'install', '--user', '--upgrade', pyPackage];
return await shellTask(py, args, `pip: ${pyPackage}`);
}
Expand Down

0 comments on commit 893aa1e

Please sign in to comment.