Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise installed pythons are not detected by vscode #63

Closed
ssbarnea opened this issue Dec 20, 2024 · 3 comments
Closed

Mise installed pythons are not detected by vscode #63

ssbarnea opened this issue Dec 20, 2024 · 3 comments

Comments

@ssbarnea
Copy link

ssbarnea commented Dec 20, 2024

While I am not sure if this extension can help vscode-python official extension to find python interpreters exposed by mise, it would clearly be very useful feature.

At this moment, even if mise is activated and working in vscode terminal, vscode python extension is failing to detect mise pythons and suggests only the ones installed via different methods. Should be noted that pyenv and asdf ones seems to be detected but I am no longer using those, since i switched to mise.

Please remark that while the .venv is detected, the two mise installed pythons are not suggested by vscode when it comes to selecting a python interpreter, even if they are in PATH. This is an issue especially for projects that do not use a .venv, and most python ones that use tox, do not have one as they rely on tox to manage these.

@hverlin
Copy link
Owner

hverlin commented Dec 20, 2024

I have documented the python + mise setup here: https://hverlin.github.io/mise-vscode/guides/python/

Let me know if this works for you. I suspect that you might run into an issue if you load it with multiple folders. In theory, your settings.json file should have been updated, but I don't see it on your screenshot.

@ssbarnea
Copy link
Author

The problem is that vscode-python is unable to detect python interpreters from mise. On the other hand, if I have a .venv inside the project, it will find it. I updated the screenshot to explain the issue better.

@hverlin
Copy link
Owner

hverlin commented Dec 22, 2024

The problem is that vscode-python is unable to detect python interpreters from mise
It does work if you set the default interpreter path in the settings.json

IMO, It's all caused by VSCode limitation on not having a good way to share settings (microsoft/vscode#40233) so the python VSCode extension had to implement some workarounds.

If they would, the Python VSCode extension could simply let us update and read from settings.json. (For example, they could have an array where one could populate all the know python versions installed on the system).

As you mentioned here microsoft/vscode-python#20752 (comment), the VSCode extension could also discover all python installations present in the PATH.

(note that there are workarounds for sharing settings currently, like https://marketplace.visualstudio.com/items?itemName=swellaby.workspace-config-plus, but best is to just do it manually. (you can add a mise task to merge the shared settings, for example)

Repository owner locked and limited conversation to collaborators Dec 28, 2024
@hverlin hverlin converted this issue into discussion #71 Dec 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants