Skip to content

Auto-detection of pixi environments #718

Closed as not planned
Closed as not planned

Description

While the Jupyter extension does a fine job of auto-detecting conda, uv, and venv Python environments, pixi environments have to be specified manually. Given the popularity of pixi it would be great to add it to the set of environments that are detected automatically.

Activity

  1. DonJayamanne commented on Aug 4, 2025

    @DonJayamanne
    Contributor

    Thank you for filing this issue.
    Do the pixi environments show up in the quick pick you get when you select the command Python: Select Interpreter
    Asking as the list of all Python envs are retrieved from the Python extension using the Python extension API.

  2. fonnesbeck commented on Aug 4, 2025

    @fonnesbeck
    Author

    They do not show up; I have to add the path manually. Should this issue be moved to the Python extension repo?

  3. bedaberner commented on Aug 7, 2025

    @bedaberner

    Thank you for filing this issue. Do the pixi environments show up in the quick pick you get when you select the command Python: Select Interpreter Asking as the list of all Python envs are retrieved from the Python extension using the Python extension API.

    I also noticed that there was a change with pixi environment detection.
    For me the environment still shows up, but it's no longer marked "pixi"

    Here you can see how it used to look like: microsoft/vscode-python#22968 (comment)

    Now it looks like a system python, you only see it's pixi from the path:

    Image

    I'm not sure I have the same issue as OP but it seems something in the pixi locator changed.

  4. martinfleis commented on Aug 11, 2025

    @martinfleis

    This has worked until recently. It seems that the environment detection is now handled by the Python Environments extension which fails to detect Pixi. Disabling it makes it work again.

  5. eleanorjboyd commented on Aug 14, 2025

    @eleanorjboyd
    Contributor

    Transferring the the python environments extension as it seems related to that specifically.

    If you enable the extension then run the command from the command palette Python: Run Python Environment Tool (PET) in Terminal... and selecting "search" does the environment you want to use show up in the terminal as part of the output when you run this?

  6. 3 remaining items

  7. martinfleis commented on Aug 14, 2025

    @martinfleis

    Yes, I see it there.

    2025-08-14T16:04:54Z WARN  pet_conda::package] Unable to find conda package Python in "/Users/martin/dev/xvec/.pixi/envs/default", trying slower approach
    [2025-08-14T16:04:54Z ERROR pet_conda] Unable to find Conda Manager for Conda env (even though we have a conda_dir "/Users/martin/micromamba"): Env Details = CondaEnvironment { prefix: "/Users/martin/micromamba", executable: None, version: None, conda_dir: Some("/Users/martin/micromamba"), arch: None }
    Environment (Conda)
       Name        : base
       Prefix      : /Users/martin/micromamba
    
    Environment (Pixi)
       Name        : default
       Executable  : /Users/martin/dev/xvec/.pixi/envs/default/bin/python
       Version     : 3.13.3
       Prefix      : /Users/martin/dev/xvec/.pixi/envs/default
       Symlinks    : "/Users/martin/dev/xvec/.pixi/envs/default/bin/python"
                   : "/Users/martin/dev/xvec/.pixi/envs/default/bin/python3"
                   : "/Users/martin/dev/xvec/.pixi/envs/default/bin/python3.1"
                   : "/Users/martin/dev/xvec/.pixi/envs/default/bin/python3.13"
    
    [2025-08-14T16:04:54Z WARN  pet_conda::package] Unable to find conda package Conda in "/Users/martin/dev/geopandas/.pixi/envs/default", trying slower approach
    Manager (Conda)
       Executable  : /Users/martin/dev/geopandas/.pixi/envs/default/bin/conda
       Version     : 25.5.1
    
    Environment (Conda)
       Executable  : /Users/martin/dev/geopandas/geopandas/.asv/env/82d1f2f94e5cf345ab602f66c4868a1d/bin/python
       Version     : 3.13.5
       Prefix      : /Users/martin/dev/geopandas/geopandas/.asv/env/82d1f2f94e5cf345ab602f66c4868a1d
       Architecture: x64
       Manager     : Conda, /Users/martin/dev/geopandas/.pixi/envs/default/bin/conda
       Symlinks    : "/Users/martin/dev/geopandas/geopandas/.asv/env/82d1f2f94e5cf345ab602f66c4868a1d/bin/python"
                   : "/Users/martin/dev/geopandas/geopandas/.asv/env/82d1f2f94e5cf345ab602f66c4868a1d/bin/python3"
                   : "/Users/martin/dev/geopandas/geopandas/.asv/env/82d1f2f94e5cf345ab602f66c4868a1d/bin/python3.1"
                   : "/Users/martin/dev/geopandas/geopandas/.asv/env/82d1f2f94e5cf345ab602f66c4868a1d/bin/python3.13"
    
    Environment (MacCommandLineTools)
       Executable  : /usr/bin/python3
       Version     : 3.9.6.final.0
       Prefix      : /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9
       Architecture: x64
       Symlinks    : "/usr/bin/python3"
                   : "/Library/Developer/CommandLineTools/usr/bin/python3"
                   : "/Library/Developer/CommandLineTools/usr/bin/python3.9"
                   : "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3"
                   : "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9"
    
    
    Breakdown by each locator:
    --------------------------
    Conda                : 8.990875ms
    Homebrew             : 22.042709ms
    MacCommandLineTools  : 39.441291ms
    MacPythonOrg         : 2.75µs
    MacXCode             : 250ns
    PipEnv               : 333ns
    Pixi                 : 667ns
    Poetry               : 611.084µs
    PyEnv                : 75.5µs
    Venv                 : 375ns
    VirtualEnv           : 291ns
    VirtualEnvWrapper    : 4.792µs
    
    Breakdown for finding Environments:
    -----------------------------------
    GlobalVirtualEnvs    : 36.583µs
    Locators             : 39.940375ms
    Path                 : 41.032708ms
    Workspaces           : 7.348625ms
    
    Managers:
    ---------
    Conda                : 1
    
    Environments (4):
    ------------------
    Conda                : 2
    MacCommandLineTools  : 1
    Pixi                 : 1
    
    Completed in 74ms
    

    It is the one in /Users/martin/dev/xvec/.pixi/envs/default/bin/python while I am currently in /Users/martin/dev/xvec/ directory. But when selecting an interpreter, it does not show up as an option.

  8. eleanorjboyd commented on Aug 14, 2025

    @eleanorjboyd
    Contributor

    very interesting! Can you confirm you are on the latest version of the environments extension (maybe the pre-release version too). I fixed a bug that looked identical to this a bit ago and just want to confirm you are on the latest version. Thanks!

  9. martinfleis commented on Aug 14, 2025

    @martinfleis

    This was 1.2.0. With 1.3.12261011 pre-release, the log is slightly uglier but the outcome is the same, no Pixi environment in selection.

  10. eleanorjboyd commented on Aug 14, 2025

    @eleanorjboyd
    Contributor

    Let me take a look through the code and see if I can figure anything out. If you have time while I do so and want to let me know if making a new pixi environment results in the same behavior (it not being shown) that would be useful as well.

  11. eleanorjboyd commented on Aug 14, 2025

    @eleanorjboyd
    Contributor

    Since you are using pixi it should be handled by our wonderful community extension! Their github repo is here and it is best if you open an issue on them specifically and they can help you out! The information here (like the PET output) should be useful to them as well. Thanks!

    https://github.com/renan-r-santos/pixi-code

  12. eleanorjboyd commented on Aug 14, 2025

    @eleanorjboyd
    Contributor

    to follow up actually you might not have the pixi extension which is what is causing this! You should install it https://marketplace.visualstudio.com/items?itemName=renan-r-santos.pixi-code and then give feedback if it does / doesn't work in the repo I sent along

  13. bedaberner commented on Aug 14, 2025

    @bedaberner

    I think part of the confusion is, that the python environment extension has become part of the default python extension bundle.
    I can only speak for myself but i have never installed something else than just the python extension and it just worked with pixi.

    While I understand the reasoning of putting it into a different extension, you should be aware that from a user perspective working behavior has been broken by this addition.
    Maybe there could be a popup to install the community extension if a .pixi folder is present or something similar just to help users find out about it?

  14. eleanorjboyd commented on Aug 14, 2025

    @eleanorjboyd
    Contributor

    This is a great point. One of the issues as of now is the current pixi support (in the python extension) is no longer being maintained by the pixi community who added it, thus the need to switch to the new extension for ongoing support. I agree tho that as a user it can feel like a regression. Let me discuss with my team on showing a notification and if you are able to confirm for me that adding the new extension functions correctly for you (ie the new extension does not introduce any bugs for you) then that will give us higher confidence to move towards a recommendation.

  15. martinfleis commented on Aug 14, 2025

    @martinfleis

    With the extension it does seem to work fine but I agree with what bedaberner said above. This is a regression from a user perspective. I need to search first through VS Code setting to learn that there is now an extension that works worse than VS Code without it and that there is another extension I need to get it working properly...

  16. bedaberner commented on Aug 15, 2025

    @bedaberner

    Also there are 2 pixi extensions in the marketplace, both seem to be one man projects not associated with the pixi team.
    The more popular one does not fix this issue. The one you linked works but almost kills the machine upon environment detection (See here renan-r-santos/pixi-code#7). Regardless I will not add another extension to my dozens of devcontainers for such a minor feature, even if there was a stable, working one.

    I would love for it to become part the official python environments extension, otherwise I will just take the current (regressed) behavior where it shows up like a system env.

  17. methuhassan8-star commented on Aug 15, 2025

    @methuhassan8-star

    Also there are 2 pixi extensions in the marketplace, both seem to be one man projects not associated with the pixi team. The more popular one does not fix this issue. The one you linked works but almost kills the machine upon environment detection (See here renan-r-santos/pixi-code#7). Regardless I will not add another extension to my dozens of devcontainers for such a minor feature, even if there was a stable, working one.

    I would love for it to become part the official python environments extension, otherwise I will just take the current (regressed) behavior where it shows up like a system env.

    Image

  18. methuhassan8-star commented on Aug 15, 2025

    @methuhassan8-star
  19. locked as resolved and limited conversation to collaborators on May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions