[Python] Visual Studio Code not showing autocomplete package list for pillow/Pylance

Discussão em 'Python' iniciado por Stack, Abril 13, 2025.

  1. Stack

    Stack Membro Participativo

    having a bit of a weird issue in VS Code with Pylance/pillow, whereby the autocomplete doesn't show for PIL when anything inherits PIL.

    As soon as PIL is used, can no longer get any autocompletes, whether it be importing as whatever, or using any function from PIL.

    For example, if I do

    import PIL as pil


    I can no longer get any of the module autocompletes other than the class attributes.

    If I just do import PIL then I can get the autocompletes of anything directly from PIL but no autocompletes for anything from those attributes (i.e. I can get autocompletes of PIL.whatever, but if I do something like PIL.ImageGrab, I can't get any autocompletes of PIL.ImageGrab, like it doesn't show stuff like PIL.ImageGrab.grab() for example).

    An example of this is newImage = PIL.ImageGrab.grab(...), as newImage.whatever then no longer shows any autocomplete options.

    I'm using a venv, venv is activated and path to pillow is correct when doing pip show pillow. No issues with any other packages in this manner.

    Python, Pylance & pip versions are both latest.

    pil recognised, but ImageGrab is greyed out as if it's not

    Continue reading...

Compartilhe esta Página