[Python] ModuleNotFoundError: No module named 'llama_index.langchain_helpers.chatgpt'

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

  1. Stack

    Stack Membro Participativo

    I'd like to use ChatGPTLLMPredictor from llama_index.langchain_helpers.chatgpt, but I got an error below on M1 Macbook Air.

    ModuleNotFoundError: No module named 'llama_index.langchain_helpers.chatgpt'


    My code looks like this and line 3 is the problem.

    import csv
    from llama_index import GPTSimpleVectorIndex, SimpleWebPageReader
    from llama_index.langchain_helpers.chatgpt import ChatGPTLLMPredictor

    article_urls = []
    with open('article-urls.csv') as f:
    reader = csv.reader(f)
    for row in reader:
    article_urls.append(row[0])

    documents = SimpleWebPageReader().load_data(article_urls)
    index = GPTSimpleVectorIndex(documents=documents, llm_predictor=ChatGPTLLMPredictor()
    )
    index.save_to_disk('index.json')

    • Python v3.10.10
    • requirements.txt

    aiohttp==3.8.4
    aiosignal==1.3.1
    async-timeout==4.0.2
    attrs==23.1.0
    cachetools==5.3.0
    certifi==2022.12.7
    charset-normalizer==3.1.0
    dataclasses-json==0.5.7
    frozenlist==1.3.3
    gptcache==0.1.14
    idna==3.4
    langchain==0.0.142
    llama-index==0.5.16
    marshmallow==3.19.0
    marshmallow-enum==1.5.1
    multidict==6.0.4
    mypy-extensions==1.0.0
    numexpr==2.8.4
    numpy==1.24.2
    openai==0.27.4
    openapi-schema-pydantic==1.2.4
    packaging==23.1
    pandas==2.0.0
    pydantic==1.10.7
    python-dateutil==2.8.2
    pytz==2023.3
    PyYAML==6.0
    regex==2023.3.23
    requests==2.28.2
    six==1.16.0
    SQLAlchemy==1.4.47
    tenacity==8.2.2
    tiktoken==0.3.3
    tqdm==4.65.0
    typing-inspect==0.8.0
    typing_extensions==4.5.0
    tzdata==2023.3
    urllib3==1.26.15
    yarl==1.8.2


    Thanks.

    Continue reading...

Compartilhe esta Página