How to use extraPython3Packages? #45
-
I am wondering how to include dependency applications which are packaged as Python packages and if that differs from including python libraries for plugins. I have a plugin that uses a Python plugin for jupyter integration (molten-nvim using lspsAndRuntimeDeps = {
general = with pkgs; [
fd
ripgrep
];
pythondev = with pkgs; [
pylyzer
ruff
(python3.withPackages
(ps: with ps; [
jupytext
cairosvg
pnglatex
]))
];
};
extraPython3Packages = {
python = ps: with ps; [
jupyter-client
];
}; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So, any plugin that is properly configured for nvim should use the value at python3_host_prog as its interpreter. So anything that is a library, or ran by another python program but shouldnt be in your path should go there. However the plugin or executable that you want accessible to your path or runtimepath should NOT go in there, because it needs to be in your PATH (or runtimepath if its a plugin). So the lsp itself would go in lspsAndRuntimeDeps, but plugins for that lsp would go into extraPython3Packages (technically it probably wouldnt break anything to put both in both haha) In addition, some plugins may be improperly configured to look for python3 from the path rather than the variable? I dont know if that is the issue you are running into rn or not but that is possible. In that case you would add a python3.withPackages env to your lspsAndRuntimeDeps and point it to that. Although what you should ACTUALLY do is file an issue with the developer because that is not correct. Basically, the env you construct via extraPython3Packages is bundled with nvim and added to your path as <packagename>-python3 and vim.g.python3_host_prog is set to that path. This is the same way that the nvim wrapper in nixpkgs works, except that one always names it nvim-python3 |
Beta Was this translation helpful? Give feedback.
So, any plugin that is properly configured for nvim should use the value at python3_host_prog as its interpreter.
So anything that is a library, or ran by another python program but shouldnt be in your path should go there.
However the plugin or executable that you want accessible to your path or runtimepath should NOT go in there, because it needs to be in your PATH (or runtimepath if its a plugin). So the lsp itself would go in lspsAndRuntimeDeps, but plugins for that lsp would go into extraPython3Packages (technically it probably wouldnt break anything to put both in both haha)
In addition, some plugins may be improperly configured to look for python3 from the path rather than the vari…