13

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)?

Incubbus
  • 265
  • 3
  • 10

1 Answers1

16

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

Toto
  • 17,001
  • 56
  • 30
  • 41
Coder_fox
  • 308
  • 4
  • 8
  • 2
    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 '22 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 '22 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 '22 at 21:57
  • "Maybe i create a feature request" Did you, @Incubbus ? – moi Jul 20 '22 at 14:36
  • @moi i did not. – Incubbus Jul 21 '22 at 06:38
  • I searched a bit and multiple existing feature requests resulted in "Just do 'Python: Restart language server'" – moi Jul 21 '22 at 09:50