You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Completions not working for modules installed within a pipenv virtual environment? #390
I use pipenv to manage my python virtual environments/projects. I've noticed that when I create and install pyls within a pipenv virtual environment, only standard modules (os, sys, etc.) have completions. External modules like numpy, requests, etc. do not show completions. The only combination that currently gives me external module completion is when I've installed pyls within an activated virtualenv created via the built-in venv module which also contains the external modules.
Reacted by Robbert van der Helm, Justin Moon, Bartolomeo Stellato, Niko Eckerskorn, Radon Rosborough, German Lashevich, Sinkerine, Delweng, kawing-chiu, ..o.n.o.. and 3 more
Any news on this? I experience the same issue. I have created a virtualenv which has access to systems modules and Jedi is properly listing modules that are non directly installed in the venv, nonetheless pyls only lists standard modules. It is like pyls is explicitly passing a syspath to Jedi which is inconsistent with Jedi’s ways of detecting it
@tommasolaurenzi This solution did not work for me with pipenv. Thanks for the suggestion though. I believe the issue may be upstream with how Jedi reads sys.path
Neither autocomplete nor go-to-definition work for me using vim with the ALE plugin when using a pipenv environment. Problem could be with ALE but figured I should chime in here.
Linting works fine. Autocomplete and go-to-definition work for standard library.
What I did to get pyls to get me proper code completions was to install pyls in my virtual environment and then use an executable script to start the pyls server with the virtual environment activated.
I am using sublime text as my editor and then fish as my terminal shell. I then wrote this fish script (easily can be rewritten in bash)
Activity
rebelot commentedon Jul 11, 2018
Any news on this? I experience the same issue. I have created a virtualenv which has access to systems modules and Jedi is properly listing modules that are non directly installed in the venv, nonetheless pyls only lists standard modules. It is like pyls is explicitly passing a syspath to Jedi which is inconsistent with Jedi’s ways of detecting it
rebelot commentedon Jul 12, 2018
FYI I use neovim, and specifying
pylsaspython -m pylssolved the issue for memjlbach commentedon Jul 12, 2018
@tommasolaurenzi This solution did not work for me with pipenv. Thanks for the suggestion though. I believe the issue may be upstream with how Jedi reads sys.path
justinmoon commentedon Aug 2, 2018
I'm having same problem.
Neither autocomplete nor go-to-definition work for me using vim with the ALE plugin when using a pipenv environment. Problem could be with ALE but figured I should chime in here.
Linting works fine. Autocomplete and go-to-definition work for standard library.
edit:
Seems Jedi is also used for go-to-definition. So @mjlbach's theory makes some sense in my case.
tacho commentedon Aug 31, 2018
I was having the same problem, but only under macOS, Linux was fine, so this got me digging. Fixed in davidhalter/jedi#1212.
esn89 commentedon Feb 13, 2019
@rebelot
How did you manage to set this? Is this in LanguageClient-neovim?
nicksspirit commentedon Jun 21, 2019
What I did to get pyls to get me proper code completions was to install pyls in my virtual environment and then use an executable script to start the pyls server with the virtual environment activated.
I am using sublime text as my editor and then fish as my terminal shell. I then wrote this fish script (easily can be rewritten in bash)
Then in sublime text I set the command to start the pyls server to be the script in sublime text's LSP settings.
sinkerine commentedon Mar 29, 2020
#657 supports passing your own syspath. I use Emacs and manage to pass my
pyenvsyspath topylsin emacs-lsp/lsp-mode#1393