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

Amazon Bedrock Workshop - ModuleNotFoundError: No module named 'langchain_aws' #289

Open
gideonsergei opened this issue Aug 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gideonsergei
Copy link

To Reproduce
Steps to reproduce the behavior (or some version of this):

  1. Go to 04_entity_extraction.ipynb
  2. Cell
    from langchain_aws import ChatBedrock

llm = ChatBedrock(
model_id="anthropic.claude-3-sonnet-20240229-v1:0",
model_kwargs={
"max_tokens": 200,
"temperature": 0, # Using 0 to get reproducible results
"stop_sequences": ["\n\nHuman:"]
}
)
3. See error

I'm running in SageMaker Studio Classic; I restarted the Kernel (data sci 3.0) but it didn't clear the error.

@gideonsergei gideonsergei added the bug Something isn't working label Aug 20, 2024
@lkampsnider
Copy link

I ran into this too. Unfortunately, the langchain_aws module ends up getting installed the JupyterSystems env folder path, which isn't a part of the sys.path. All you need to do to work around this is add the missing path to sys.path as part of your cell script.

import sys
sys.path
sys.path.append('/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.10/site-packages')

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants