# windows: Detect when \`python3\` is not usable and notify the user \(\#40070\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/6a1648825c49ddc6c385bdb3cf269b8910b967bc)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 6a1648825c49ddc6c385bdb3cf269b8910b967bc

Requested commit: 6a1648825c49ddc6c385bdb3cf269b8910b967bc

Commit: 6a1648825c49ddc6c385bdb3cf269b8910b967bc

Tree: b269d1f730ddf09537026b528691be202f626ec8

Author: Cole Miller

Committer: GitHub

## Message

```
windows: Detect when `python3` is not usable and notify the user (#40070)

Fixes #39998

Debugpy and pylsp are installed in a Zed-global venv with pip. We need a
Python interpreter to create this venv when it doesn't exist and one of
these tools needs to be installed, and sometimes we attempt to use
`python3` from `$PATH`. This can cause issues on Windows, where out of
the box `python3` is a sort of shim that opens the Microsoft Store app.

This PR changes the debugpy installation path to create the Zed-global
venv using the Python interpreter from a venv in the project, and only
use python3 from `$PATH` if that fails. That matches how pylsp
installation already works. It also tightens up how we search for a
global Python installation by doing a basic sanity check (`python3 -c
'print(1 + 2)`) before accepting it, which should catch the Windows
shim.

Release Notes:

- windows: improved the behavior of Zed in situations where no global
Python installation exists.
```

## Parents

- [f0d097c66a80ce013525455420ca1e78e4b689c4](https://git.cafe/gitcafe/zed/commit/f0d097c66a80ce013525455420ca1e78e4b689c4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/6a1648825c49ddc6c385bdb3cf269b8910b967bc?format=markdown)
