jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.81k stars 148 forks source link

Pip installation not working with python language server #273

Open marimeireles opened 4 years ago

marimeireles commented 4 years ago

Hello! Thank you very much for this project and the great work. :)

Description

I was trying to create an environment as described in the readme using the pip installation of python language server, but it doesn't work for me. The only way it works is if I install conda install -c conda-forge python-language-server.

Reproduce

  1. Follow steps 1 through 6 on README file.
  2. Run jupyter lab on terminal Get the following result:
-2020-05-24 17:01:33,673 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'autopep8': No module named 'autopep8'                          
2020-05-24 17:01:33,678 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'mccabe': No module named 'mccabe'
2020-05-24 17:01:33,679 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'pycodestyle': No module named 'pycodestyle'
2020-05-24 17:01:33,680 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'pydocstyle': No module named 'pydocstyle'
2020-05-24 17:01:33,680 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'pyflakes': No module named 'pyflakes'
2020-05-24 17:01:33,681 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'pylint': No module named 'pylint'
2020-05-24 17:01:33,682 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'rope_completion': No module named 'rope'
2020-05-24 17:01:33,682 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'rope_rename': No module named 'rope'
2020-05-24 17:01:33,683 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'yapf': No module named 'yapf'

Context

krassowski commented 4 years ago

Thank you for your feedback! The warnings that you see are not errors by themselves - those barely indicate that additional extensions of python-language-server cannot be loaded as the extra (optional) dependencies are not installed.

To install all the optional pyls extensions with pip you would need to run: pip install 'python-language-server[all]'. I suspect that the conda option may just install everything by default. Please head over to pyls README for more details.

We may want to mention this in our README, but then this information is easily accessible from in the pyls repository - and we already recommend to check out the websites of the servers you install:

Note: it is worth visiting the repository of each server you install as many provide additional configuration options.

Does it make sense?

@bollwyvl 7 seconds difference ;)

bollwyvl commented 4 years ago

Thanks for testing it out!

A pip freeze would help, as well.

Perhaps try:

pip install --upgrade python-language-server[all]

... perhaps we should encourage that as a default.

I am very pro-entry_points, and we even support discovery of language server specs with them on the backend of this repo, but this experience with pyls has soured me on them some.

I don't understand why it ships broken-by-default. Theoretically, It can be configured but we don't have that up and running yet yet (#245), and it probably still would be it broken at startup time as I still haven't figured out how to check in a pyls configuration on a project.

The reason the conda-forge one works: on python-language-server-feedstock, it's basically packaged with [all], and pip checked before distribution, which is why it works predictably... albeit verbosely since it tries to load everything.

marimeireles commented 4 years ago

To install all the optional pyls extensions with pip you would need to run: pip install 'python-language-server[all]'. I suspect that the conda option may just install everything by default. Please head over to pyls README for more details.

Hey @krassowski and @bollwyvl, thanks for the replies! Sorry for not making it clearer, that's what I did and I still got these.

bollwyvl commented 4 years ago

ok, then taking a look at the issue template and providing that information, or at least pip freeze would help.

krassowski commented 4 years ago

@marimeireles were you able to replicate this behaviour or did the problem go away? If it did not, it would be of great use to have a proper reproduction steps.