Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Jedi in VS Code #266

Open
DP1701 opened this issue Apr 18, 2023 · 9 comments
Open

Problems with Jedi in VS Code #266

DP1701 opened this issue Apr 18, 2023 · 9 comments
Labels
help wanted Extra attention is needed vscode-extension-issue

Comments

@DP1701
Copy link

DP1701 commented Apr 18, 2023

Hi, when I switch to Jedi in VS Code, built in modules are recognised correctly but other modules (for example PyTorch) installed with pip are not.

Details can already be read here.
microsoft/vscode-python#21060 (comment)

Does anyone have an idea what the problem could be?

@jpele-tis
Copy link

jpele-tis commented May 22, 2023

I've got the same issue here microsoft/vscode-python#21265
So last working version on VSCode was jedi-language-server==0.34.12 used in Python extension 2021.12.*

@andriati-alex
Copy link

Apparently, this is not only in vscode, but I'm using neovim and algo get the same problem. Completions for builtin libs fine, but for any external package no sign

@pappasam
Copy link
Owner

pappasam commented Sep 1, 2023

Apparently, this is not only in vscode, but I'm using neovim and algo get the same problem. Completions for builtin libs fine, but for any external package no sign

Have you activated your virtual environment before opening Vim? I'm using neovim, just tested out completions from a 3rd party package, and things work fine for me.

@andriati-alex
Copy link

Apparently, this is not only in vscode, but I'm using neovim and algo get the same problem. Completions for builtin libs fine, but for any external package no sign

Have you activated your virtual environment before opening Vim? I'm using neovim, just tested out completions from a 3rd party package, and things work fine for me.

Yes, in my setup I use the Mason plugin to install the language servers, and apart from that, I have the virtual environment I work on properly activated, and yet no completions for third part packages

@pappasam pappasam added the help wanted Extra attention is needed label Sep 8, 2023
@regob
Copy link

regob commented Nov 17, 2023

I have the same issue with VSCode.
It seems when initializing the language server options the environment is not passed. If I print the environment path where the lsp is initialized, it's None already. So I gues this should be passed somehow.

Enabling verbose mode using

sys.argv += ['-v']
sys.exit(cli())

when starting the language server in the vscode extension the messages are printed, and I don't see VSCode passing the environment anywhere


2023-11-17 11:04:44.535 [info] INFO:pygls.protocol:Language server initialized InitializeParams(... LOTS OF PARAMS ..., client_info=InitializeParamsClientInfoType(name='Visual Studio Code', version='1.84.2'), locale='en', root_path='/home/rego/.vscode-server/extensions/ms-python.python-2023.20.0', root_uri='file:///home/rego/.vscode-server/extensions/ms-python.python-2023.20.0', initialization_options={'markupKindPreferred': 'markdown', 'completion': {'resolveEagerly': False, 'disableSnippets': True}, 'diagnostics': {'enable': True, 'didOpen': True, 'didSave': True, 'didChange': True}, 'hover': {'disable': {'keyword': {'all': True}}}, 'workspace': {'extraPaths': ['/home/rego/.vscode-server/extensions/ms-python.python-2023.20.0'], 'symbols': {'maxSymbols': 0}}}, trace=<TraceValues.Off: 'off'>, work_done_token=None, workspace_folders=[WorkspaceFolder(uri='file:///home/rego/.vscode-server/extensions/ms-python.python-2023.20.0', name='ms-python.python-2023.20.0')])

@rohit901
Copy link

rohit901 commented Jan 5, 2024

Any fix for this? I seem to have similar problem and I have described it in coder/code-server#6619

I hope this can be fixed..

@zengziru
Copy link

I have the same question!!!

@davidhalter
Copy link

You guys have to help us somehow with what's actually going wrong. It feels like the wrong environment is detected. But why is the wrong environment detected? What is special about your installations? How many Python versions have you installed? Are you using virtualenvs? What is your editor/IDE?

Writing "I have the same question!!!" is not helpful at all. If you want us to put in work always think of us as humans, too. Try to put in your absolute best into helping us solve the problem.

@zengziru
Copy link

You guys have to help us somehow with what's actually going wrong. It feels like the wrong environment is detected. But why is the wrong environment detected? What is special about your installations? How many Python versions have you installed? Are you using virtualenvs? What is your editor/IDE?

Writing "I have the same question!!!" is not helpful at all. If you want us to put in work always think of us as humans, too. Try to put in your absolute best into helping us solve the problem.

OK,I have solved the problem this afternoon, just download "Pyright" extention from vscode market, it can solve all problems. Because of the consideration of security, I have to use "code-server" to attach the server, but "Pylance" can not be used in code-server. So I have to use jedi, while it seems that it can not detect the virtual conda environment automatically...
So just use "Pyright", it can solve all problems. Thank you for all efforts trying to solve the problem for almost one year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed vscode-extension-issue
Projects
None yet
Development

No branches or pull requests

8 participants