[Python] Failing to import `sentence_transformers` even though it is installed

Discussão em 'Python' iniciado por Stack, Junho 29, 2025.

  1. Stack

    Stack Membro Participativo

    This is the code I've been trying to run:

    try:
    from sentence_transformers import SentenceTransformer, util
    print("sentence_transformers is installed.")
    except ImportError:
    print("sentence_transformers is not installed.")


    Can anyone help me out as to why is this happening or what could I have been doing wrong? Even though I have it installed, it keeps giving me the same error every time I try using it.

    I have tried uninstalling it and installing it again but it keeps throwing the same error over and over for some reason. When I run pip show sentence_transformers this is what I see:

    # Output of the pip command should go here

    Continue reading...

Compartilhe esta Página