16

Every time i install a python library using pip (e.g. pip install requests) i have to reload Visual Studio Code, so it starts scanning installed libraries (even when using the pip install-command from within the VS-Code-activated shell).

If i don't do this i don't have "Intellisense" for that library and the imports just show a squiggle with unresolved imports.

Is there a way to "fix" this without having to reload the window (Command Palette > Reload Window)?

1 Answer 1

18

I have found that you can do ctrl + shift + p and select Python: Restart language server.

6
  • 3
    Marked as answer, because it technically answers the question. But this is actually not very satisfying, too, because in the end it's nearly the same as what i did.
    – Incubbus
    Feb 16, 2022 at 14:30
  • 2
    @Incubbus It doesn't reload VScode and is nearly instantaneous which is technically the solution. I haven't found a better way, sorry.
    – Coder_fox
    Feb 16, 2022 at 18:32
  • 1
    Yes, sorry. I did phrase it wrong. It's still a better solution. But it still requires manually restarting the language server. Maybe i create a feature request for a watch-mode for the python-libs folder that are checked by the extension or so.
    – Incubbus
    Feb 16, 2022 at 21:57
  • "Maybe i create a feature request" Did you, @Incubbus ?
    – moi
    Jul 20, 2022 at 14:36
  • @moi i did not.
    – Incubbus
    Jul 21, 2022 at 6:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .