Visitar URL original
LSP installed using `pixi global` doesn't find packages · Issue #3227 · prefix-dev/pixi · GitHub
Skip to content

LSP installed using pixi global doesn't find packages #3227

Closed

Description

@JaRoSchm

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

pixi-global.toml:

[envs.python-lsp-server-base]
channels = ["conda-forge"]
dependencies = { python-lsp-server-base = "*" }
exposed = { pylsp = "pylsp" }

shell-hook:

eval "$(pixi shell-hook --shell=zsh --manifest-path=/path/to/pixi.toml)"

Issue description

I installed different Python LSP servers, e.g. python-lsp-server (but also others), using pixi global install .... Additionally, I "activated" a pixi environment using pixi shell-hook .... I would expect the LSP server to find the installed packages in the pixi environment for auto-completion. This is, however, not the case although the LSP server is running. If I install the LSP servers using uv tool install ... (with --python=/usr/bin/python3.12) or if I add the LSP servers to the pixi environment, everything works as expected. The problem persists with pixi shell instead of pixi shell-hook. Therefore, I think that this isn't a problem of the LSP servers but of the combination of pixi global and pixi shell-hook/shell.

Expected behavior

See above.

Activity

  1. ruben-arts commented on Feb 28, 2025

    @ruben-arts
    Contributor

    I think the problem is that an LSP should be installed in the environment of the interpreter that is being used. So that would mean adding it to the pixi project environment instead of globally installing it. Just like you do with uv except with pixi projects python is installed in the project itself instead of using a system wide interpreter.

  2. JaRoSchm commented on Feb 28, 2025

    @JaRoSchm
    Author

    Thanks, this makes sense from a technical point of view. However, in principle I think that an LSP is one of the most suited examples for pixi global. It is a personal choice, which not every collaborator of a project may share. Additionally, one would usually use the same one for every project one is working on. Because of that an LSP server seemed like a perfect use of pixi global. So is there maybe some solution to make this work?

  3. JaRoSchm commented on Jul 10, 2025

    @JaRoSchm
    Author

    The reason for this on the pylsp side and possible solution are discussed in python-lsp/python-lsp-server#643
    So I am sure now that this isn't a problem with pixi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions