[Python] python import yaml - but which one? [duplicate]

Discussão em 'Python' iniciado por Stack, Agosto 14, 2025.

  1. Stack

    Stack Membro Participativo

    Ok, so you clone a repo, there's an import

    import yaml

    ok, so you do pip install yaml and you get:

    ERROR: No matching distribution found for yaml

    Ok, so you look for a package with yaml in it, and there's like a gazillion of them... usually adding py in front does the job, but...

    How on earth should I know which one was used?!

    And it's not just yaml, oh no... there's:

    import cv2 # python-opencv

    import PIL # Pillow

    and the list goes on and on...

    How can I know which import uses which package? Shouldn't there be a PEP for this? Or a naming convention, e.g. import is always the same as the package name?

    There's a similar topic here, if you're not frustrated enough :)

    Continue reading...

Compartilhe esta Página