Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
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

Description

@qubitron

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.

Activity

  1. DonJayamanne commented on Jan 29, 2019

    @DonJayamanne

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

  2. jakebailey commented on Jan 29, 2019

    @jakebailey
    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.

  3. MikhailArkhipov commented on Mar 1, 2019

    @MikhailArkhipov

    With #611

    image

    image

  4. qubitron commented on May 6, 2019

    @qubitron
    Author

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

  5. MikhailArkhipov commented on Jun 21, 2019

    @MikhailArkhipov
  6. Hubro commented on Jul 7, 2019

    @Hubro

    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.

  7. jakebailey commented on Jul 8, 2019

    @jakebailey
    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.

  8. Hubro commented on Feb 22, 2020

    @Hubro

    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

  9. jakebailey commented on Feb 24, 2020

    @jakebailey
    Member
  10. Hubro commented on Feb 24, 2020

    @Hubro

    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?

  11. jakebailey commented on Feb 24, 2020

    @jakebailey
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions