-
Notifications
You must be signed in to change notification settings - Fork 182
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
Support automatic recognition of pixi environments in IDEs: VS Code #411
Comments
I would really love that! But I really hope that it could be made without any ties to Python. I really like that Pixi positions itself as being cross-platform and ecosystem-agnostic. So many people don't see Conda as a general-purpose package manager, because they think it's Python-only. And I see where it comes from, but I hope it won't be the case for Pixi. E.g. direnv has nice VS Code extensions that would load the environment into the IDE on startup. Probably something like that could be done for Pixi. |
I started some initial work here: microsoft/vscode-python#22968 Lets see what happens! |
It seems there is a problem for jupyter notebooks inside vscode. It is possible to manually specify a pixi python interpreter as kernel but vscode does not detect ipykernel even if it is installed:
|
@j-bac is |
Yes it is part of the pixi.toml (which defines a single environment)
|
I was able to get the IPython kernel to work in VS Code by running the kernelspec install inside the pixi environment. [tasks]
install-kernel = "python -m ipykernel install --user --name <kernel name> --display-name <kernel name>" |
Thanks that worked! |
A side effect of no auto-discovery is that if you initialise a new project and create a Jupyter notebook - VSCode won't show you any Pixi kernels before you firstly, create any |
I guess this issue can be closed, right? Amazing work @baszalmstra! 🥳 |
Closing as it is included in the 2024.10.0 version: https://github.com/microsoft/vscode-python/releases/tag/v2024.10.0 |
Question, the release notes also mention adding support for https://github.com/microsoft/python-environment-tools. This does not support Pixi: microsoft/python-environment-tools#46. What is the difference between this and the locator? From an outsider perspective they seem to do the same. |
Problem description
As discussed on Discord, there currently isn't a proper integration with VS Code yet.
It would be great if pixi environments automagically show up when selecting the Python interpreter via
Python: Select Interpreter
(see VS Code Python Interpreter Docs), as do conda, poetry, venv and other environments.Current workaround
Manually select the pixi environment python executable as described in the VS Code Docs and mentiond in #166 (comment).
However, this may not work for all VS Code Python features as described in #412.
Related information
The text was updated successfully, but these errors were encountered: