Closed julioyildo closed 3 years ago
Thank you for opening this issue. I read it carefully but unfortunately, I cannot help much without having the bug report template filled in. It appears that you might have chosen a different template, or deleted it.
The template asks for information that we need in order to be able to help you. We know that this is a big ask, but this helps us diagnose issues quicker and gives us more time to improve this extension. If you have a problem filling it, please let us know and we will try to help (or improve the template if needed).
Hi @krassowski ,
Sure ! :)
I'm trying to use the key features of Jupyterlab-lsp, but I'm having some issues: Auto-completion, Continuous Hinting, Rename and Jump to Definition
do not work when installing the library.
I just done the basics steps of the library
Jupyterlab-lsp
from statistics import mean
jupyter core : 4.7.1
jupyter-notebook : 6.2.0
qtconsole : not installed
ipython : 7.20.0
ipykernel : 5.4.2
jupyter client : 6.1.11
jupyter lab : 3.0.5
nbconvert : 6.0.7
ipywidgets : 7.6.3
nbformat : 5.1.2
traitlets : 5.0.5
jupyter_lsp enabled - Validating jupyter_lsp... jupyter_lsp 1.1.4 OK jupyterlab enabled - Validating jupyterlab... jupyterlab 3.0.5 OK
JupyterLab v3.0.5 /opt/conda/share/jupyter/labextensions @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets) @krassowski/jupyterlab-lsp v3.5.0 enabled OK (python, jupyterlab_lsp)
Paste the output from running `jupyter troubleshoot` from the command line here. You may want to sanitize the paths in the output. pip list: Package Version ----------------------------- ------------------- alembic 1.5.4 anyio 2.1.0 argon2-cffi 20.1.0 astroid 2.5.1 async-generator 1.10 attrs 20.3.0 autopep8 1.5.5 Babel 2.9.0 backcall 0.2.0 backports.functools-lru-cache 1.6.1 bleach 3.3.0 blinker 1.4 brotlipy 0.7.0 cachetools 4.2.1 certifi 2020.12.5 certipy 0.1.3 cffi 1.14.4 chardet 4.0.0 conda 4.9.2 conda-package-handling 1.7.2 configparser 5.0.2 cryptography 3.3.1 cycler 0.10.0 datalab 1.2.0 decorator 4.4.2 defusedxml 0.6.0 docstring-to-markdown 0.7 entrypoints 0.3 flake8 3.8.4 future 0.18.2 google-api-core 1.26.1 google-api-python-client 2.0.2 google-auth 1.28.0 google-auth-httplib2 0.1.0 google-cloud-bigquery 1.28.0 google-cloud-bigquery-storage 1.1.0 google-cloud-core 1.6.0 google-cloud-monitoring 0.31.1 google-crc32c 1.1.2 google-resumable-media 1.2.0 googleapis-common-protos 1.53.0 grpcio 1.36.1 httplib2 0.19.0 idna 2.10 imageio 2.9.0 importlib-metadata 3.4.0 ipykernel 5.4.2 ipympl 0.5.8 ipython 7.20.0 ipython-genutils 0.2.0 ipywidgets 7.6.3 isort 5.8.0 jedi 0.17.2 Jinja2 2.11.3 joblib 1.0.1 json5 0.9.5 jsonschema 3.2.0 jupyter-client 6.1.11 jupyter-core 4.7.1 jupyter-lsp 1.1.4 jupyter-server 1.3.0 jupyter-telemetry 0.1.0 jupyterhub 1.3.0 jupyterlab 3.0.5 jupyterlab-lsp 3.5.0 jupyterlab-pygments 0.1.2 jupyterlab-server 2.2.0 jupyterlab-widgets 1.0.0 kiwisolver 1.3.1 lazy-object-proxy 1.6.0 Mako 1.1.4 MarkupSafe 1.1.1 matplotlib 3.3.4 mccabe 0.6.1 mistune 0.8.4 mock 4.0.3 nbclassic 0.2.6 nbclient 0.5.1 nbconvert 6.0.7 nbformat 5.1.2 nest-asyncio 1.4.3 networkx 2.5 notebook 6.2.0 numpy 1.20.1 oauth2client 4.1.3 oauthlib 3.0.1 packaging 20.9 pamela 1.0.0 pandas 0.25.3 pandas-profiling 1.4.0 pandocfilters 1.4.2 parso 0.7.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 8.1.2 pip 21.0.1 plotly 4.14.3 pluggy 0.13.1 prometheus-client 0.9.0 prompt-toolkit 3.0.14 protobuf 3.15.6 psutil 5.8.0 ptyprocess 0.7.0 pyarrow 3.0.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycodestyle 2.6.0 pycosat 0.6.3 pycparser 2.20 pycurl 7.43.0.6 pydocstyle 6.0.0 pyflakes 2.2.0 Pygments 2.7.4 PyJWT 2.0.1 pylint 2.7.2 pyOpenSSL 20.0.1 pyparsing 2.4.7 pyrsistent 0.17.3 PySocks 1.7.1 python-dateutil 2.8.1 python-editor 1.0.4 python-json-logger 2.0.1 python-jsonrpc-server 0.4.0 python-language-server 0.36.2+49.g3536061 pytz 2021.1 PyWavelets 1.1.1 PyYAML 5.4.1 pyzmq 22.0.1 requests 2.25.1 retrying 1.3.3 rope 0.18.0 rsa 4.7.2 ruamel-yaml-conda 0.15.80 ruamel.yaml 0.16.12 ruamel.yaml.clib 0.2.2 scikit-image 0.18.1 scikit-learn 0.24.1 scipy 1.6.1 seaborn 0.11.1 Send2Trash 1.5.0 setuptools 49.6.0.post20210108 six 1.15.0 sniffio 1.2.0 snowballstemmer 2.1.0 SQLAlchemy 1.3.23 terminado 0.9.2 testpath 0.4.4 threadpoolctl 2.1.0 tifffile 2021.3.17 toml 0.10.2 tornado 6.1 tqdm 4.56.0 traitlets 5.0.5 ujson 4.0.2 uritemplate 3.0.1 urllib3 1.26.3 wcwidth 0.2.5 webencodings 0.5.1 wheel 0.36.2 widgetsnbextension 3.5.1 wrapt 1.12.1 yapf 0.31.0 zipp 3.4.0 conda list: # packages in environment at /opt/conda: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge alembic 1.5.4 pyhd8ed1ab_0 conda-forge anyio 2.1.0 py38h578d9bd_0 conda-forge argon2-cffi 20.1.0 py38h497a2fe_2 conda-forge astroid 2.5.1 pypi_0 pypi async_generator 1.10 py_0 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge autopep8 1.5.5 pypi_0 pypi babel 2.9.0 pyhd3deb0d_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.1 py_0 conda-forge bleach 3.3.0 pyh44b312d_0 conda-forge blinker 1.4 py_1 conda-forge brotlipy 0.7.0 py38h497a2fe_1001 conda-forge bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.17.1 h36c2ea0_0 conda-forge ca-certificates 2020.12.5 ha878542_0 conda-forge cachetools 4.2.1 pypi_0 pypi certifi 2020.12.5 py38h578d9bd_1 conda-forge certipy 0.1.3 py_0 conda-forge cffi 1.14.4 py38ha65f79e_1 conda-forge chardet 4.0.0 py38h578d9bd_1 conda-forge conda 4.9.2 py38h578d9bd_0 conda-forge conda-package-handling 1.7.2 py38h8df0ef7_0 conda-forge configparser 5.0.2 pypi_0 pypi configurable-http-proxy 1.3.0 0 conda-forge cryptography 3.3.1 py38h2b97feb_1 conda-forge cycler 0.10.0 pypi_0 pypi datalab 1.2.0 pypi_0 pypi decorator 4.4.2 py_0 conda-forge defusedxml 0.6.0 py_0 conda-forge docstring-to-markdown 0.7 pypi_0 pypi entrypoints 0.3 pyhd8ed1ab_1003 conda-forge flake8 3.8.4 pypi_0 pypi future 0.18.2 pypi_0 pypi google-api-core 1.26.1 pypi_0 pypi google-api-python-client 2.0.2 pypi_0 pypi google-auth 1.28.0 pypi_0 pypi google-auth-httplib2 0.1.0 pypi_0 pypi google-cloud-bigquery 1.28.0 pypi_0 pypi google-cloud-bigquery-storage 1.1.0 pypi_0 pypi google-cloud-core 1.6.0 pypi_0 pypi google-cloud-monitoring 0.31.1 pypi_0 pypi google-crc32c 1.1.2 pypi_0 pypi google-resumable-media 1.2.0 pypi_0 pypi googleapis-common-protos 1.53.0 pypi_0 pypi grpcio 1.36.1 pypi_0 pypi httplib2 0.19.0 pypi_0 pypi icu 68.1 h58526e2_0 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge imageio 2.9.0 pypi_0 pypi importlib-metadata 3.4.0 py38h578d9bd_0 conda-forge importlib_metadata 3.4.0 hd8ed1ab_0 conda-forge ipykernel 5.4.2 py38h81c977d_0 conda-forge ipympl 0.5.8 pypi_0 pypi ipython 7.20.0 py38h81c977d_2 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.6.3 pypi_0 pypi isort 5.8.0 pypi_0 pypi jedi 0.17.2 pypi_0 pypi jinja2 2.11.3 pyh44b312d_0 conda-forge joblib 1.0.1 pypi_0 pypi json5 0.9.5 pyh9f0ad1d_0 conda-forge jsonschema 3.2.0 py_2 conda-forge jupyter-lsp 1.1.4 pypi_0 pypi jupyter_client 6.1.11 pyhd8ed1ab_1 conda-forge jupyter_core 4.7.1 py38h578d9bd_0 conda-forge jupyter_server 1.3.0 py38h578d9bd_0 conda-forge jupyter_telemetry 0.1.0 pyhd8ed1ab_1 conda-forge jupyterhub 1.3.0 py38h578d9bd_0 conda-forge jupyterhub-base 1.3.0 py38h578d9bd_0 conda-forge jupyterlab 3.0.5 pyhd8ed1ab_0 conda-forge jupyterlab-lsp 3.5.0 pypi_0 pypi jupyterlab-widgets 1.0.0 pypi_0 pypi jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_server 2.2.0 pyhd8ed1ab_0 conda-forge kiwisolver 1.3.1 pypi_0 pypi krb5 1.17.2 h926e7f8_0 conda-forge lazy-object-proxy 1.6.0 pypi_0 pypi ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge libcurl 7.71.1 hcdd3856_8 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libffi 3.3 h58526e2_2 conda-forge libgcc-ng 9.3.0 h2828fa1_18 conda-forge libgomp 9.3.0 h2828fa1_18 conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libsodium 1.0.18 h36c2ea0_1 conda-forge libssh2 1.9.0 hab1572f_5 conda-forge libstdcxx-ng 9.3.0 h6de172a_18 conda-forge libuv 1.40.0 h7f98852_0 conda-forge mako 1.1.4 pyh44b312d_0 conda-forge markupsafe 1.1.1 py38h497a2fe_3 conda-forge matplotlib 3.3.4 pypi_0 pypi mccabe 0.6.1 pypi_0 pypi mistune 0.8.4 py38h497a2fe_1003 conda-forge mock 4.0.3 pypi_0 pypi nbclassic 0.2.6 pyhd8ed1ab_0 conda-forge nbclient 0.5.1 py_0 conda-forge nbconvert 6.0.7 py38h578d9bd_3 conda-forge nbformat 5.1.2 pyhd8ed1ab_1 conda-forge ncurses 6.2 h58526e2_4 conda-forge nest-asyncio 1.4.3 pyhd8ed1ab_0 conda-forge networkx 2.5 pypi_0 pypi nodejs 15.3.0 h92b4a50_1 conda-forge notebook 6.2.0 py38h578d9bd_0 conda-forge numpy 1.20.1 pypi_0 pypi oauth2client 4.1.3 pypi_0 pypi oauthlib 3.0.1 py_0 conda-forge openssl 1.1.1i h7f98852_0 conda-forge packaging 20.9 pyh44b312d_0 conda-forge pamela 1.0.0 py_0 conda-forge pandas 0.25.3 pypi_0 pypi pandas-profiling 1.4.0 pypi_0 pypi pandoc 2.11.4 h7f98852_0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.7.1 pypi_0 pypi pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 8.1.2 pypi_0 pypi pip 21.0.1 pyhd8ed1ab_0 conda-forge plotly 4.14.3 pypi_0 pypi pluggy 0.13.1 pypi_0 pypi prometheus_client 0.9.0 pyhd3deb0d_0 conda-forge prompt-toolkit 3.0.14 pyha770c72_0 conda-forge protobuf 3.15.6 pypi_0 pypi psutil 5.8.0 pypi_0 pypi ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pyarrow 3.0.0 pypi_0 pypi pyasn1 0.4.8 pypi_0 pypi pyasn1-modules 0.2.8 pypi_0 pypi pycodestyle 2.6.0 pypi_0 pypi pycosat 0.6.3 py38h497a2fe_1006 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pycurl 7.43.0.6 py38h996a351_1 conda-forge pydocstyle 6.0.0 pypi_0 pypi pyflakes 2.2.0 pypi_0 pypi pygments 2.7.4 pyhd8ed1ab_0 conda-forge pyjwt 2.0.1 pyhd8ed1ab_0 conda-forge pylint 2.7.2 pypi_0 pypi pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyrsistent 0.17.3 py38h497a2fe_2 conda-forge pysocks 1.7.1 py38h578d9bd_3 conda-forge python 3.8.6 hffdb5ce_4_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python-editor 1.0.4 py_0 conda-forge python-json-logger 2.0.1 pyh9f0ad1d_0 conda-forge python-jsonrpc-server 0.4.0 pypi_0 pypi python-language-server 0.36.2+49.g3536061 pypi_0 pypi python_abi 3.8 1_cp38 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pywavelets 1.1.1 pypi_0 pypi pyyaml 5.4.1 pypi_0 pypi pyzmq 22.0.1 py38h3d7ac18_0 conda-forge readline 8.0 he28a2e2_2 conda-forge requests 2.25.1 pyhd3deb0d_0 conda-forge retrying 1.3.3 pypi_0 pypi rope 0.18.0 pypi_0 pypi rsa 4.7.2 pypi_0 pypi ruamel.yaml 0.16.12 py38h497a2fe_2 conda-forge ruamel.yaml.clib 0.2.2 py38h497a2fe_2 conda-forge ruamel_yaml 0.15.80 py38h497a2fe_1004 conda-forge scikit-image 0.18.1 pypi_0 pypi scikit-learn 0.24.1 pypi_0 pypi scipy 1.6.1 pypi_0 pypi seaborn 0.11.1 pypi_0 pypi send2trash 1.5.0 py_0 conda-forge setuptools 49.6.0 py38h578d9bd_3 conda-forge six 1.15.0 pyh9f0ad1d_0 conda-forge sniffio 1.2.0 py38h578d9bd_1 conda-forge snowballstemmer 2.1.0 pypi_0 pypi sqlalchemy 1.3.23 py38h497a2fe_0 conda-forge sqlite 3.34.0 h74cdb3f_0 conda-forge terminado 0.9.2 py38h578d9bd_0 conda-forge testpath 0.4.4 py_0 conda-forge threadpoolctl 2.1.0 pypi_0 pypi tifffile 2021.3.17 pypi_0 pypi tini 0.18.0 h14c3975_1001 conda-forge tk 8.6.10 h21135ba_1 conda-forge toml 0.10.2 pypi_0 pypi tornado 6.1 py38h497a2fe_1 conda-forge tqdm 4.56.0 pyhd8ed1ab_0 conda-forge traitlets 5.0.5 py_0 conda-forge ujson 4.0.2 pypi_0 pypi uritemplate 3.0.1 pypi_0 pypi urllib3 1.26.3 pyhd8ed1ab_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.36.2 pyhd3deb0d_0 conda-forge widgetsnbextension 3.5.1 pypi_0 pypi wrapt 1.12.1 pypi_0 pypi xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge yapf 0.31.0 pypi_0 pypi zeromq 4.3.4 h9c3ff4c_0 conda-forge zipp 3.4.0 py_0 conda-forge zlib 1.2.11 h516909a_1010 conda-forge
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Paste the output from your browser JavaScript console replacing the text in here. To learn how to open the developer tools in your browser: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools#How_to_open_the_devtools_in_your_browser If too many messages accumulated after many hours of working in JupyterLab, consider refreshing the window and then reproducing the bug to reduce the noise in the logs.
Thank you for your help !
Looking at the 4. See error: no auto-completion
, I do not see an error there. It looks like the completion is slow (this, is slower than you type), but it does work and the slowness is not because of this extension (jupyterlab-lsp) but of the particular language server that you chosen to use (pyls).
That server (pyls) is known to be slow at completion because of how the jedi evolved (and it did not, and how the company that created it initially apparently abandoned it). There are many other servers for Python out there, including jedi-language-server, pylance, and my fork of pyls, that as I see you already tried and are satisfied with. I do not know how else I could help here.
To re-iterate, yes there is a known problem with the performance of completion in pyls, but I am not a creator of it, nor a maintainer and this is not the right repository for it. Yes, I did manage to fix the performance on my fork and we (with Spyder folks) recently tried to revive the development of pyls and will release a better, derivative server, but under a different name.
As for the other features that you mention (jump to definition and rename), I would really need a reproducible example, ideally with the output of the developer console from your browser after attempting these actions.
The only way to make it works was to install pip install git+https://github.com/krassowski/python-language-server.git@main, but the documentation doesn't recommend to use it in production environnement.
To clarify, I would not recommend anyone to build a product around it, or ship to JupyterHub deployment with hundreds of users, but if this is just for your own use (or use by a small team), I would not worry about it too much. Just mentioning because I know how many different things people can understand by "production".
@krassowski thank you very much for your answers.
That server (pyls) is known to be slow at completion because of how the jedi evolved (and it did not, and how the company that created it initially apparently abandoned it). There are many other servers for Python out there, including jedi-language-server, pylance, and my fork of pyls, that as I see you already tried and are satisfied with. I do not know how else I could help here.
Okay, I would like to test with jedi-language-server
.
Do I just have to just uninstall python-language-server
and then install pip install -U jedi-language-server
? :)
To clarify, I would not recommend anyone to build a product around it, or ship to JupyterHub deployment with hundreds of users, but if this is just for your own use (or use by a small team), I would not worry about it too much. Just mentioning because I know how many different things people can understand by "production".
Okay, I understand! Actually, we just want to use it in our Data Science team ( 10 to 15 users). :)
Do I just have to just uninstall python-language-server and then install pip install -U jedi-language-server ? :)
Basically yes. However you will also need to upgrade IPython to 7.20 if using jedi-language-server 0.22+. Or you could just install 0.21.
@krassowski i did uninstall python-language-server
and switch to jedi-language-server
but it was way less features no ?
i don't see completion with params in the functions anymore, and no flake-8 plugin, do you think we can mix both ?
Yes, jedi-language-server
implements fewer features. We do plan to allow mixing multiple servers and I did some work towards it recently, but a lot more work is needed. jedi-language-server
provides some diagnostics but only for some syntax errors, and indeed no support for flake8, see: https://github.com/pappasam/jedi-language-server#language-features
Thank you @krassowski for your answers. I am closing this issue.
Hello !
I'm trying to use the key features of Jupyterlab-lsp, but I'm having some issues :
Auto-completion
,Continuous Hinting
,Rename
andJump to Definition
do not works when installing the library.I have also tried several configurations on the
Advanced Setting Editor
but without success.My language server configuration:
And Code Completion:
The only way to make it works was to install
pip install git+https://github.com/krassowski/python-language-server.git@main
, but the documentation doesn't recommend to use it in production environnement.Could you please guide me?
Thank you ! :)