Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidKeyException found installing library for deployment. #21111

Closed
5 tasks done
uyuyuyjk opened this issue Apr 30, 2024 · 7 comments
Closed
5 tasks done

InvalidKeyException found installing library for deployment. #21111

uyuyuyjk opened this issue Apr 30, 2024 · 7 comments
Assignees
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@uyuyuyjk
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

from langchain.storage import LocalFileStore

Error Message and Stack Trace (if applicable)

from langchain.storage import LocalFileStore
/usr/local/lib/python3.11/site-packages/langchain/storage/init.py:15: in
from langchain.storage.file_system import LocalFileStore
/usr/local/lib/python3.11/site-packages/langchain/storage/file_system.py:8: in
from langchain.storage.exceptions import InvalidKeyException
/usr/local/lib/python3.11/site-packages/langchain/storage/exceptions.py:1: in
from langchain_community.storage.exceptions import InvalidKeyException
/usr/local/lib/python3.11/site-packages/langchain_community/storage/exceptions.py:1: in
from langchain_core.stores import InvalidKeyException
E ImportError: cannot import name 'InvalidKeyException' from 'langchain_core.stores'

Description

I had 0.1.16 version of langchain installed and this morning pulled up fresh docker to re-install my environment, found out a back compatibility issue.

Langchain depends on langchain_community, which a few days ago was using 0.0.34, now that it updated to 0.0.35. langchain's import of LocalFileStore would fail.

System Info

OS: Linux
Python: 3.11
Langchain: 0.1.16

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Apr 30, 2024
@eyurtsev
Copy link
Collaborator

Could you share the output of:

python -m langchain_core.sys_info

@eyurtsev eyurtsev self-assigned this Apr 30, 2024
@eyurtsev
Copy link
Collaborator

We're re-releasing

@matrodge
Copy link

ran into likely the same pr similar issue:
python -m langchain_core.sys_info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000
Python Version: 3.9.6 (default, Feb 3 2024, 15:58:27)
[Clang 15.0.0 (clang-1500.3.9.4)]

Package Information

langchain_core: 0.1.47
langchain: 0.1.16
langchain_community: 0.0.35
langsmith: 0.1.52
langchain_openai: 0.1.4
langchain_text_splitters: 0.0.1
langgraph: 0.0.39

Packages not installed (Not Necessarily a Problem)

The following packages were not found:

langserve

Traceback (most recent call last):
File "/Users/matrodge/Git/adopta_python_test9/main.py", line 53, in
from adopta import AdoptaClass
File "/Users/matrodge/Git/adopta_python_test9/adopta/init.py", line 3, in
from .adopta import AdoptaClass
File "/Users/matrodge/Git/adopta_python_test9/adopta/adopta.py", line 41, in
from langchain.retrievers import ContextualCompressionRetriever
File "/Users/matrodge/Git/adopta_python_test9/.venv/lib/python3.9/site-packages/langchain/retrievers/init.py", line 29, in
from langchain.retrievers.multi_vector import MultiVectorRetriever
File "/Users/matrodge/Git/adopta_python_test9/.venv/lib/python3.9/site-packages/langchain/retrievers/multi_vector.py", line 14, in
from langchain.storage._lc_store import create_kv_docstore
File "/Users/matrodge/Git/adopta_python_test9/.venv/lib/python3.9/site-packages/langchain/storage/init.py", line 15, in
from langchain.storage.file_system import LocalFileStore
File "/Users/matrodge/Git/adopta_python_test9/.venv/lib/python3.9/site-packages/langchain/storage/file_system.py", line 8, in
from langchain.storage.exceptions import InvalidKeyException
File "/Users/matrodge/Git/adopta_python_test9/.venv/lib/python3.9/site-packages/langchain/storage/exceptions.py", line 1, in
from langchain_community.storage.exceptions import InvalidKeyException
File "/Users/matrodge/Git/adopta_python_test9/.venv/lib/python3.9/site-packages/langchain_community/storage/exceptions.py", line 1, in
from langchain_core.stores import InvalidKeyException
ImportError: cannot import name 'InvalidKeyException' from 'langchain_core.stores' (/Users/matrodge/Git/adopta_python_test9/.venv/lib/python3.9/site-packages/langchain_core/stores.py)

@jland-redhat
Copy link

jland-redhat commented Apr 30, 2024

I am also running into this issue:

Just downgraded my langchain_core to 0.1.46 from a few days ago and it seems to work again.

!pip install langchain_core=0.1.46

@eyurtsev
Copy link
Collaborator

Could you try with the following versions of community and core?

langchain-community==0.0.36
[langchain-core==0.1.48]https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D0.1.48

@stawils
Copy link

stawils commented May 1, 2024

i had same error during open-webui installation
(
from langchain_core.stores import InvalidKeyException
ImportError: cannot import name 'InvalidKeyException' from 'langchain_core.stores'

)

@eyurtsev , by adding:
langchain-community==0.0.36
langchain-core==0.1.48

it fixed the problem.

@eyurtsev
Copy link
Collaborator

eyurtsev commented May 1, 2024

Marking as resolved

@eyurtsev eyurtsev closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

5 participants