You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Package list shows "No packages found" when pip emits an upgrade notice (JSON parse failure) #1650
The Python Environments sidebar reports "No packages found" for a venv that actually has packages installed. The root cause is that the extension parses pip list --format=json output as JSON, but older pip versions append a [notice] A new release of pip is available... message to stdout after the JSON array, which breaks parsing.
Environment:
Python Envs extension version: 1.37.2026070201
OS: macOS
Env type: venv (ms-python.python:venv)
Python: 3.10.20
pip: 23.0.1 (bundled; emits upgrade notice to stdout)
Steps to reproduce:
Create/select a venv whose pip is outdated enough to print an upgrade notice (e.g. pip 23.0.1).
Install one or more packages (e.g. pytest).
Open the Python Environments sidebar and click the environment.
Expected behavior:
The installed packages (pytest, pluggy, iniconfig, etc.) are listed.
Actual behavior:
The sidebar shows "No packages found." The output log shows the package refresh failing to parse JSON:
Running: .../.venv/bin/python -m pip list --format=json
python: [{"name": "pip", "version": "23.0.1"}, {"name": "setuptools", "version": "79.0.1"}]
python:
[notice] A new release of pip is available: 23.0.1 -> 26.1.2
[notice] To update, run: .../.venv/bin/python -m pip install --upgrade pip
Failed to parse pip list JSON output Unexpected non-whitespace character after JSON at position 85 (line 3 column 1)
The packages are genuinely installed — a manual pip list confirms pytest 9.1.1 and its dependencies are present. Only the extension's parsing fails.
Additional related symptoms (same root cause):
A "problem installing packages" notification can appear even when the install itself succeeds, because the post-install package refresh fails to parse.
Transient No module named pip errors immediately after in-place venv recreation (python3.10 -m venv .venv), before pip is bootstrapped, trigger the same refresh failure path.
Suggested fix:
Make the pip-list parser robust to non-JSON trailing output. Options:
Extract only the JSON array/object from stdout before parsing (e.g. slice from the first [/{ to its matching close), rather than JSON.parse(entireStdout).
Run pip with --disable-pip-version-check (and/or PIP_DISABLE_PIP_VERSION_CHECK=1) when listing packages to suppress the notice.
Pass --no-python-version-warning / route notices to stderr where feasible.
Activity
eleanorjboyd commentedon Jul 23, 2026
Hi Eduardo Villalpando Mello (@edvilme) could you take a look at this PR and test the issue
edvilme commentedon Jul 23, 2026
Transfering to https://github.com/microsoft/vscode-python-environments
Don't show version warning
edvilme commentedon Aug 3, 2026
Should be addressed by #1686
edvilme commentedon Aug 20, 2026
Should be addressed by #1717 too