Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

IntelliSense/completions not updating after installing package into current virtual environment #562

Closed
qubitron opened this issue Jan 29, 2019 · 11 comments · Fixed by #1306
Assignees
Milestone

Comments

@qubitron
Copy link

Using Microsoft Python Language Server version 0.1.78.0 with 2019.1.0 of the extension, on Windows 10.

Actual:

  • Have virtual environment without requests installed
  • Type import requests, see warning that module is not found (correct)
  • Open terminal, pip install requests into virtual environment
  • Go back to editor and keep typing, module is still not found
  • Reload VS Code, intellisense for requests starts working

Expected: after installing requests, the language server picks up completions for newly installed packages without having to restart VS Code.

I believe this is a regression, as this used to work.

@qubitron qubitron added the GA label Jan 29, 2019
@DonJayamanne
Copy link

Oh, I thought it never did work, as I've been reloading VSC.

@jakebailey
Copy link
Member

See also microsoft/PTVS#5026. I think this is a consequence of the module resolution stuff where we don't re-analyze if the packages change.

@MikhailArkhipov
Copy link

With #611

image

image

@MikhailArkhipov MikhailArkhipov added this to the Feb 2019.2 milestone Mar 1, 2019
@MikhailArkhipov MikhailArkhipov self-assigned this Mar 1, 2019
@qubitron qubitron reopened this May 6, 2019
@qubitron
Copy link
Author

qubitron commented May 6, 2019

This doesn't appear to be working, same repro, the squiggle goes away after reloading

@MikhailArkhipov MikhailArkhipov removed this from the Feb 2019.2 milestone Jun 20, 2019
@MikhailArkhipov
Copy link

#1076, #1213

@Hubro
Copy link

Hubro commented Jul 7, 2019

This is an extreme hassle. There's no way to reload the language server without reloading the entire window, which terminates all processes running in the terminal windows.

@jakebailey
Copy link
Member

I'm currently working on fixing the file watcher to detect package installs (see those linked issues above), but as a workaround you can also kill the language server process directly. That's obviously not perfect (and after the 5th restart, the VS Code language server client will stop restarting things), but would allow you to not kill your terminal windows.

@Hubro
Copy link

Hubro commented Feb 22, 2020

This still happens ☹️

After installing package:

image

After reloading the window:

image

My VSCode version:

image

Python extension:

image

I'm using pipenv if that matters, and I'm installing packages by running pipenv install ...:

image

@jakebailey
Copy link
Member

We've made this opt-in, as it was causing more issues than it was solving (#1841). If you'd like to restore this, you can see: https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#completions-do-not-update-andor-import-is-still-being-reported-as-unresolved-after-pip-install

@Hubro
Copy link

Hubro commented Feb 24, 2020

We've made this opt-in, as it was causing more issues than it was solving (#1841). If you'd like to restore this, you can see: https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#completions-do-not-update-andor-import-is-still-being-reported-as-unresolved-after-pip-install

Well it wouldn't be a big deal if I didn't have to reload the entire window. Why isn't there a command to rescan libraries? Or a command to restart the language server?

@jakebailey
Copy link
Member

A command to restart the LS without a reload would be microsoft/vscode-python#3073.

Feasibly without this directly supported, you can kill the LS process itself and it will be restarted up to 5 times, or you can select a different interpreter and switch back, but these are workarounds.

Again, you can re-enable that option and see if it's stable for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants