langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
95.67k stars 15.54k forks source link

AzureSearch error #27643

Open codenamics opened 1 month ago

codenamics commented 1 month ago

Checked other resources

Example Code

index_name: str = "langchain-vector-demo"
vector_store: AzureSearch = AzureSearch(
    azure_search_endpoint=vector_store_address,
    azure_search_key=vector_store_password,
    index_name=index_name,
    embedding_function=embeddings.embed_query,
)

Error Message and Stack Trace (if applicable)

Exception ignored in: <function AzureSearch.del at 0x000002B588070FE0>
Traceback (most recent call last): File "C:\Users\n\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain_community\vectorstores\azuresearch.py", line 393, in del File "C:\Users\n\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 761, in get_event_loop_policy File "C:\Users\n\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 754, in _init_event_loop_policy ImportError: sys.meta_path is None, Python is likely shutting down

Description

Made everything as here:

https://python.langchain.com/docs/integrations/vectorstores/azuresearch/

when calling it i get error like above

System Info

python 3.12 langchain latest

keenborder786 commented 1 month ago

It has nothing to do with Langchain, their is something wrong with your python environment. Or how you are starting the asyncio event loop. Can you share code so I can help you better

paprocki-r commented 3 weeks ago

related https://github.com/langchain-ai/langchain/issues/27511