当前位置:   article > 正文

解决langchain文件elastic_vector_search.py的version_num = client.infoversion“][“number“][0]错误_cannot import name 'vst' from 'langchain.vectorsto

cannot import name 'vst' from 'langchain.vectorstores.base

错误截图:出现在es8版本及以上结合langchain的时候

 解决方案:

pip install langchain==0.0.242

错误代码:Traceback (most recent call last):
  File "c:\Users\19288\Downloads\新建文件夹\es.py", line 1, in <module>
    from langchain.embeddings.openai import OpenAIEmbeddings
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\__init__.py", line 6, in <module>
    from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\agents\__init__.py", line 2, in <module>
    from langchain.agents.agent import (
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\agents\agent.py", line 16, in <module>
    from langchain.agents.tools import InvalidTool
s\Python\Python311\Lib\site-packages\langchain\prompts\__init__.py", line 12, in <module>   
    from langchain.prompts.example_selector import (
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\prompts\example_selector\__init__.py", line 4, in <module>
    from langchain.prompts.example_selector.semantic_similarity import (
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\prompts\example_selector\semantic_similarity.py", line 10, in <module>
    from langchain.vectorstores.base import VectorStore
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\vectorstores\__init__.py", line 18, in <module>
    from langchain.vectorstores.elastic_vector_search import (
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\vectorstores\elastic_vector_search.py", line 299
    version_num = client.infoversion"]["number"][0]
                                              ^
SyntaxError: unterminated string literal (detected at line 299)
ams\Python\Python311\Lib\site-packages\langchain\prompts\example_selector\semantic_similarity.py", line 10, in <module>
    from langchain.vectorstores.base import VectorStore
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\vectorstores\__init__.py", line 18, in <module>
    from langchain.vectorstores.elastic_vector_search import (
  File "C:\Users\19288\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\vectorstores\elastic_vector_search.py", line 299
    version_num = client.infoversion"]["number"][0]
                                              ^
SyntaxError: unterminated string literal (detected at line 299)

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/697502
推荐阅读
相关标签
  

闽ICP备14008679号