Skip to content
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

unable to find pylsp #21452

Open
1 task
Obsidianage opened this issue Dec 3, 2024 · 11 comments
Open
1 task

unable to find pylsp #21452

Obsidianage opened this issue Dec 3, 2024 · 11 comments
Labels
language server failure Language server doesn't work as expected python Python programming language support

Comments

@Obsidianage
Copy link

Obsidianage commented Dec 3, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Language server error: pylsp

failed to spawn command. path: "C:\Users\AppData\Local\Zed\languages\pylsp\pylsp-venv\bin\pylsp", working directory: "D:\Coding\Python", args: []
-- stderr--

Environment

python

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

@Obsidianage Obsidianage added admin read bug [core label] labels Dec 3, 2024
@notpeter notpeter added windows python Python programming language support and removed triage labels Dec 3, 2024
@gryevns
Copy link

gryevns commented Dec 4, 2024

Occurs on mac too, can be ignored by disabling pylsp via settings

  "languages": {
    "Python": {
      "language_servers": ["!pylsp", "..."]
    }
  }

Running version 0.163.3

@shakfu
Copy link

shakfu commented Dec 19, 2024

I'm getting the same problem on an M1 Mac on Zed version 0.166.1 (01883a4) where even if add

"languages": {
      "Python": {
        "language_servers": ["!pylsp"]
      }
    }

I get the error:

Language server error: pylsp

oneshot canceled
-- stderr--
~/Library/Application Support/Zed/languages/pylsp/pylsp-venv/bin/pylsp: line 2: ~/Library/Application Support/Zed/languages/pylsp/pylsp-venv/bin/python3.13: No such file or directory
~/Library/Application Support/Zed/languages/pylsp/pylsp-venv/bin/pylsp: line 2: exec: ~/Library/Application Support/Zed/languages/pylsp/pylsp-venv/bin/python3.13: cannot execute: No such file or directory

@shakfu
Copy link

shakfu commented Dec 20, 2024

As a fix to the error my prior post, I suggest to remove and re-install the zed editor and then if you still get the error as I did, then do the following:

cd ~/Library/Application\ Support/Zed/languages/pylsp
rm -rf pylsp-venv
virtualenv pylsp-venv
source pylsp-venv/bin/activate
pip install "python-lsp-server[all]"

The pylsp error disappeared after the above.

@TorratDev
Copy link
Contributor

TorratDev commented Jan 2, 2025

Hello everyone! :D

I had the same problem on windows 11 and I made a PR with a simple change to make it work, at least on windows 11.

The PR: #22587

If you try it and it fails let me know and I'll check it again.

github-merge-queue bot pushed a commit that referenced this issue Jan 3, 2025
Closes #ISSUE

- #21452 

Describe the bug / provide steps to reproduce it

Language server error: pylsp

failed to spawn command. path:
"C:\Users\AppData\Local\Zed\languages\pylsp\pylsp-venv\bin\pylsp",
working directory: "D:\Coding\Python", args: []
-- stderr--

Environment
- Windows 11
- python

Release Notes:

- Windows: Fixed the path building used to run `pip` commands in the
venv generated on Windows 11.

---------

Co-authored-by: Marshall Bowers <[email protected]>
@ZachZimm
Copy link

ZachZimm commented Jan 5, 2025

On Arch Linux I fixed this by installing python-lsp-server from the package manager.

github-merge-queue bot pushed a commit that referenced this issue Jan 6, 2025
Based on the python #21452
and PR #22587

I found the same problem with go on windows.

Describe the bug / provide steps to reproduce it

Language server error: gopls

The system cannot find the file specified. (os error 2)
-- stderr--

[ERROR project::lsp_store] Failed to start language server "gopls": The
system cannot find the file specified. (os error 2)
[ERROR project::lsp_store] server stderr: ""

Environment

    Windows 11
    Go

Release Notes:

- Windows: Fixed `gopls` path construction on Windows 11.

---------

Co-authored-by: Marshall Bowers <[email protected]>
@aretrace
Copy link

have this issue as well, on macOS

@Phelsong
Copy link

Phelsong commented Jan 31, 2025

This is a version mismatch with the pylsp-venv wheels, if you delete it will auto rebuild next launch and resolve itself.
This broke on arch when they moved from 3.12 -> 3.13

Image

delete:
~/.local/share/zed/languages/pylsp/pylsp-venv
or
$HOME\AppData\Local\Zed\languages\pylsp\pylsp-venv
or
w/e the mac path is

They probably need to add a check of the versions on startup and rebuild on mismatch.

@bobrocke
Copy link

This is a version mismatch with the pylsp-venv wheels, if you delete it will auto rebuild next launch and resolve itself. This broke on arch when they moved from 3.12 -> 3.13

Image

delete: ~/.local/share/zed/languages/pylsp/pylsp-venv or $HOME\AppData\Local\Zed\languages\pylsp\pylsp-venv or w/e the mac path is

What is the Mac path?

@hobson
Copy link

hobson commented Feb 14, 2025

I had the same problem on Linux (Ubuntu/Mint). @shakfu 's OSX answer worked for me after changing the application path to ~/.local/share/zed and the virtualenv command to python -m virtualenv .... This ensure's the correct virtualenv and python versions on my system.

cd ~/.local/share/zed/languages/pylsp
rm -rf pylsp-venv
python -m virtualenv pylsp-venv
source pylsp-venv/bin/activate
pip install "python-lsp-server[all]"

@fkarlsson
Copy link

fkarlsson commented Feb 20, 2025

This is a version mismatch with the pylsp-venv wheels, if you delete it will auto rebuild next launch and resolve itself. This broke on arch when they moved from 3.12 -> 3.13
Image
delete: ~/.local/share/zed/languages/pylsp/pylsp-venv or $HOME\AppData\Local\Zed\languages\pylsp\pylsp-venv or w/e the mac path is

What is the Mac path?

The Mac path is here:

~/Library/Application Support/Zed/languages/pylsp/pylsp-venv

I faced this issue and did as was suggested by @Phelsong, deleted pylsp-venv and restarted Zed. The directory is recreated and I've had no issues after that.

@beniaminzagan beniaminzagan removed the bug [core label] label Feb 22, 2025
@beniaminzagan
Copy link
Member

Can reproduce on my mac as well in zed preview 175.3, and deleting as suggesting above worked. But shouldn't zed take care of this @osiewicz ?

@beniaminzagan beniaminzagan added language server failure Language server doesn't work as expected and removed windows labels Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language server failure Language server doesn't work as expected python Python programming language support
Projects
None yet
Development

No branches or pull requests