GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Show message in logs when `distutils` is missing. (#21125) · Al8a/vscode-python@60db593

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pythonFiles
    • create_venv.py
  • src/client
    • pythonEnvironments/creation/provider
      • venvProgressAndTelemetry.ts
    • telemetry
      • index.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pythonFiles/create_venv.py‎

Copy file name to clipboardExpand all lines: pythonFiles/create_venv.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,17 @@ def main(argv: Optional[Sequence[str]] = None) -> None:
161161
venv_installed = is_installed("venv")
162162
pip_installed = is_installed("pip")
163163
ensure_pip_installed = is_installed("ensurepip")
164+
distutils_installed = is_installed("distutils")
164165

165166
if not venv_installed:
166167
if sys.platform == "win32":
167168
raise VenvError("CREATE_VENV.VENV_NOT_FOUND")
168169
else:
169170
use_micro_venv = True
171+
if not distutils_installed:
172+
print("Install `python3-distutils` package or equivalent for your OS.")
173+
print("On Debian/Ubuntu: `sudo apt install python3-distutils`")
174+
raise VenvError("CREATE_VENV.DISTUTILS_NOT_INSTALLED")
170175

171176
if venv_exists(args.name):
172177
# A virtual environment with same name exists.
Collapse file

‎src/client/pythonEnvironments/creation/provider/venvProgressAndTelemetry.ts‎

Copy file name to clipboardExpand all lines: src/client/pythonEnvironments/creation/provider/venvProgressAndTelemetry.ts
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const INSTALLING_PIP_MARKER = 'CREATE_VENV.INSTALLING_PIP';
2929
const INSTALL_PIP_FAILED_MARKER = 'CREATE_VENV.INSTALL_PIP_FAILED';
3030
const DOWNLOADING_PIP_MARKER = 'CREATE_VENV.DOWNLOADING_PIP';
3131
const DOWNLOAD_PIP_FAILED_MARKER = 'CREATE_VENV.DOWNLOAD_PIP_FAILED';
32+
const DISTUTILS_NOT_INSTALLED_MARKER = 'CREATE_VENV.DISTUTILS_NOT_INSTALLED';
3233

3334
export class VenvProgressAndTelemetry {
3435
private readonly processed = new Set<string>();
@@ -88,6 +89,16 @@ export class VenvProgressAndTelemetry {
8889
return PIP_NOT_INSTALLED_MARKER;
8990
},
9091
],
92+
[
93+
DISTUTILS_NOT_INSTALLED_MARKER,
94+
(_progress: CreateEnvironmentProgress) => {
95+
sendTelemetryEvent(EventName.ENVIRONMENT_FAILED, undefined, {
96+
environmentType: 'venv',
97+
reason: 'noDistUtils',
98+
});
99+
return VENV_NOT_INSTALLED_MARKER;
100+
},
101+
],
91102
[
92103
VENV_NOT_INSTALLED_MARKER,
93104
(_progress: CreateEnvironmentProgress) => {
Collapse file

‎src/client/telemetry/index.ts‎

Copy file name to clipboardExpand all lines: src/client/telemetry/index.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,7 @@ export interface IEventNamePropertyMapping {
20572057
*/
20582058
[EventName.ENVIRONMENT_FAILED]: {
20592059
environmentType: 'venv' | 'conda' | 'microvenv';
2060-
reason: 'noVenv' | 'noPip' | 'other';
2060+
reason: 'noVenv' | 'noPip' | 'noDistUtils' | 'other';
20612061
};
20622062
/**
20632063
* Telemetry event sent before installing packages.

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.