Comments (6)
By
pylsp can be configured to include search paths from other locations
do you mean via the hidden symlink trick I've seen somewhere around the docs, or is there another configuration I can try?No, I mean that pylsp has
pylsp.plugins.jedi.extra_paths
option (https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md) which tells Jedi (a library used by pylsp for completion and some other features) to search in specific paths for installed libraries.What packages need to be installed where?
Depends on your configuration; one option is:
* JupyterLab environment: jupyter-lsp, jupyterlab-lsp, pylsp + install all libraries you import on runtime * Kernel environment: all libraries you import on runtime
Another option is:
* JupyterLab environment: jupyter-lsp, jupyterlab-lsp, pylsp + configure `pylsp.plugins.jedi.extra_paths` to point to kernel environment * Kernel environment: all libraries you import on runtime
But the second option only works if the lab environment can see the kernel environment (e.g. they are on the same machine).
Do I understand you right that these both options bind the jupyterlab environment to only one working kernel environment? Is there a general way to use autocompletion & jumping to sources while I am working with multiple environments at a time?
P.S. My case include only local environments on the same machine/OS.
from jupyterlab-lsp.
Kernel should provide their own completions and LSP their own. These are merged and reconciled so you should be getting both. I would suggest checking in settings whether kernel completions do not happen to be disabled.
from jupyterlab-lsp.
Thank you for the reply! Unfortunately it doesn't seem to be working that way for me, unless I missed some configuration:
Lab pod (with jupyterlab-lsp
, jupyter-lsp
and python-lsp-server
installed):
root@jupyter:/srv/jupyterhub# pip list | grep lsp
jupyter-lsp 2.2.2
jupyterlab-lsp 5.0.2
python-lsp-jsonrpc 1.1.2
python-lsp-server 1.10.0
Kernel (with jupyter-lsp
(wasn't sure if necessary but did it just in case) and python-lsp-server
installed):
edw@hadoop-yarn-nodemanager-0:/$ pip list | grep lsp
jupyter-lsp 2.2.2
jupyterlab-lsp 5.0.2
python-lsp-jsonrpc 1.1.2
python-lsp-server 1.10.0
Relevant settings (I tried setting the timeout to 10000):
from jupyterlab-lsp.
Currently the completions from IPython kernel only work after you actually imported the Path
from pathlib
/DataFrame
from pandas and defined the variable you are trying to complete on (a
). It is not clear from the screenshot if that was the case. For local installations pylsp can be configured to include search paths from other locations, I am not sure if this would work for remote kernels though.
from jupyterlab-lsp.
The a
variable was already defined at the time of me trying to get completions for it (the a.values is printed below in the screenshot). So just for me to see if I understand correctly so I can experiment with this further, the auto discover functionality of jupyterlab-lsp uses the lsp installed on the remote kernel? Or how do the kernel side completions work?
What packages need to be installed where?
Jupyterlab: jupyter-lsp, jupyterlab-lsp and pylsp
Kernel: pylsp? jupyter-lsp?
By pylsp can be configured to include search paths from other locations
do you mean via the hidden symlink trick I've seen somewhere around the docs, or is there another configuration I can try?
from jupyterlab-lsp.
By
pylsp can be configured to include search paths from other locations
do you mean via the hidden symlink trick I've seen somewhere around the docs, or is there another configuration I can try?
No, I mean that pylsp has pylsp.plugins.jedi.extra_paths
option (https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md) which tells Jedi (a library used by pylsp for completion and some other features) to search in specific paths for installed libraries.
What packages need to be installed where?
Depends on your configuration; one option is:
- JupyterLab environment: jupyter-lsp, jupyterlab-lsp, pylsp + install all libraries you import on runtime
- Kernel environment: all libraries you import on runtime
Another option is:
- JupyterLab environment: jupyter-lsp, jupyterlab-lsp, pylsp + configure
pylsp.plugins.jedi.extra_paths
to point to kernel environment - Kernel environment: all libraries you import on runtime
But the second option only works if the lab environment can see the kernel environment (e.g. they are on the same machine).
from jupyterlab-lsp.
Related Issues (20)
- Follow the XDG base directory specification for the .virtual_documents folder
- Only one "Code Completion" settings seen when enabling "Continuous hinting" HOT 2
- pycodestyle false positive HOT 2
- Is @krassowski/jupyterlab-lsp still need to be installed? HOT 1
- Acceptance tests are failing on Windows with Python 3.8 (but pass with Python 3.11) HOT 2
- Need to update mitigation of file editors `extensionFactory` issue before release
- IHaskell + HLS support HOT 2
- Consider using the `bin` field from `package.json` for specs derived from `NodeModuleSpec`
- Jupyterlab-lsp Error: Uncaught Exception GET /lsp/ws/pyls (::1) HOT 5
- jupyter_lsp - different location of jupyter-lsp-notebook.json between 2.2.2 and 2.2.3 HOT 3
- Markdown cells generate a lot of errors in browser logs and seem to block other extensions, like jupyterlab-spellchecker HOT 2
- GitHub release artifacts are not separate for jupyter-lsp and jupyterlab-lsp HOT 1
- Code Jump only in the same notebook HOT 4
- Plugin has no transformers yet. HOT 2
- JSON completion introduces unexpected character HOT 1
- Environment variables set for lsp servers leak into the server/kernel
- Define custom code extractors in settings HOT 4
- getting this error about `jupyter_lsp` HOT 2
- Auto completion do not need to click `Tab` HOT 2
- Renaming symbol empties all raw cells
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyterlab-lsp.