[Python] ImportError: cannot import name 'VertexAIVectorSearch' from langchain_google_vertexai...

Discussão em 'Python' iniciado por Stack, Julho 17, 2025.

  1. Stack

    Stack Membro Participativo

    I am building a RAG chatbot using Python, LangChain, and Google Vertex AI. I am getting a persistent ImportError when trying to import VertexAIVectorSearch, even after performing a clean re-installation of all libraries.

    The Error:

    Traceback (most recent call last): File "C:...\app.py", line 12, in <module> from document_processor import process_and_upload_documents File "C:...\document_processor.py", line 7, in <module> from langchain_google_vertexai.vectorstores import VertexAIVectorSearch ImportError: cannot import name 'VertexAIVectorSearch' from 'langchain_google_vertexai.vectorstores' (...)


    what i have tried Installing the C++ Build Tools for Visual Studio to ensure packages like numpy can be built from source.

    Completely uninstalling all langchain and google-cloud packages with pip uninstall.

    Re-installing all packages from a requirements.txt file.

    Trying multiple import paths, including langchain_community.vectorstores and langchain_google_vertexai. The error changes slightly but always indicates the class cannot be found.

    Deleting the pycache folder.

    Continue reading...

Compartilhe esta Página