Notes for fixing extension activation failures and Python environment warnings when using Ansible 26.6+, Python Environments, and ms-python.python in Cursor on macOS.
Tested on Cursor ~1.105 (VS Code 1.105 base), macOS arm64, June 2026.
- Notification: "Extension activation failed" — root cause is usually
ms-python.python - Log error:
TypeError: Cannot read properties of undefined (reading 'onDidChangeEnvironment') at createEnvExtApi (ms-python.python-2025.6.1) - Ansible warning: "Python environment discovery is degraded (PET binary missing). This commonly occurs in OpenVSX-based editors (Dev Spaces, VSCodium)."
- Ansible prompt: "The Python Environments extension requires 'python.useEnvironmentsExtension' to be enabled..."
Three extensions interact badly in Cursor:
| Extension | Issue |
|---|---|
ms-python.python 2025.6.x |
Calls Python Environments API during activation; crashes in Cursor's extension host |
ms-python.vscode-python-envs |
Required by Ansible 26.6+; OpenVSX universal build omits native PET binary |
redhat.ansible 26.6+ |
Hard-depends on both extensions above; checks for PET in python-envs install dir |
Not the cause: Pylance capped at 2024.8.1 in Cursor — that is expected, not a bug.
Ansible cannot uninstall ms-python.vscode-python-envs — it is a declared dependency:
"extensionDependencies": [
"ms-python.python",
"ms-python.vscode-python-envs",
"redhat.vscode-yaml"
]Install a version before the broken envs API integration:
cursor --install-extension ms-python.python@2024.20.0Verify:
cursor --list-extensions --show-versions | rg ms-python.python
# ms-python.python@2024.20.0Pin it so Cursor does not auto-upgrade back to 2025.6.x:
- Extensions → Python → gear icon → Disable Auto Update
- Confirm
"pinned": truein~/.cursor/extensions/extensions.jsonforms-python.python
If upgraded accidentally, reinstall:
cursor --install-extension ms-python.python@2024.20.0OpenVSX universal builds of ms-python.vscode-python-envs lack
python-env-tools/bin/pet. Ansible checks for PET in the python-envs extension
directory, not the Python extension directory.
Copy PET from the (platform-specific) Python extension, or from a prior install:
PYTHON_EXT="$HOME/.cursor/extensions/ms-python.python-2024.20.0"
ENVS_EXT="$HOME/.cursor/extensions/ms-python.vscode-python-envs-1.10.0-universal"
mkdir -p "$PYTHON_EXT/python-env-tools/bin"
# if pet missing in 2024.20.0, copy from an older darwin-arm64 python extension:
# cp "$HOME/.cursor/extensions/ms-python.python-2025.6.1-darwin-arm64/python-env-tools/bin/pet" \
# "$PYTHON_EXT/python-env-tools/bin/pet"
chmod +x "$PYTHON_EXT/python-env-tools/bin/pet"
mkdir -p "$ENVS_EXT/python-env-tools/bin"
ln -sf "$PYTHON_EXT/python-env-tools/bin/pet" "$ENVS_EXT/python-env-tools/bin/pet"Note: Re-do this symlink after Python Environments or Python extension updates.
Add to ~/Library/Application Support/Cursor/User/settings.json:
{
"python.defaultInterpreterPath": "/opt/homebrew/bin/python3",
"python.useEnvironmentsExtension": true,
"ansible.python.interpreterPath": "/opt/homebrew/bin/python3"
}Do not put a repo-specific .venv path in global user settings — it applies to
every workspace. With useEnvironmentsExtension enabled, Python Environments auto-selects
.venv when present in the open project.
For repo-specific overrides, use .vscode/settings.json in that repo only.
Cmd+Shift+P → Developer: Reload Window
- No "Extension activation failed" for
ms-python.python - No Ansible PET degraded warning
- Terminal auto-activation of
.venvin repos that have one - Ansible, Python, and Python Environments all remain installed
ms-python.python@2024.20.0 # pinned
ms-python.vscode-python-envs@1.10.0 # required by Ansible; do not remove
ms-python.vscode-pylance@2024.8.1 # latest Cursor allows
redhat.ansible@26.6.0
Extension host log:
~/Library/Application Support/Cursor/logs/<latest>/window1/exthost/exthost.log
Python extension output:
~/Library/Application Support/Cursor/logs/<latest>/window1/exthost/ms-python.python/Python.log
Python Environments output:
~/Library/Application Support/Cursor/logs/<latest>/window1/exthost/ms-python.vscode-python-envs/Python Environments.log
Look for:
Extension activation failure: ms-python.python[Ansible] PET binary check: ... — missing[pet] Starting Python Locator ...
| Message | Cause |
|---|---|
MCP spawn npx ENOENT |
Cursor cannot find npx in PATH when launched from Dock |
GitLens Could not resolve hashgraph/infrastructure |
GitHub API / repo access, not extension activation |
When Cursor upgrades its underlying VS Code base enough that:
ms-python.python2025.6+ activates cleanly withms-python.vscode-python-envs- OpenVSX or marketplace ships platform-specific python-envs builds with PET included
Until then, keep Python pinned at 2024.20.0.