Skip to content

Amazon Bedrock Agent Samples - [Cannot import Self from 'typing' - version issue?] #146

@manbearshark

Description

@manbearshark

Trying to run Hello World example, run into:

(.venv) ➜ amazon-bedrock-agent-samples git:(main) ✗ python3 examples/multi_agent_collaboration/00_hello_world_agent/main.py --recreate_agents "true"
Traceback (most recent call last):
File "/Users/igorkrtolica/Development/amazon-bedrock-agent-samples/examples/multi_agent_collaboration/00_hello_world_agent/main.py", line 9, in
from src.utils.bedrock_agent import Agent, SupervisorAgent, Task
File "/Users/igorkrtolica/Development/amazon-bedrock-agent-samples/src/utils/bedrock_agent.py", line 33, in
from typing import Self, Callable, Union
ImportError: cannot import name 'Self' from 'typing' (/Users/igorkrtolica/.pyenv/versions/3.9.17/lib/python3.9/typing.py)

This issue crops up after following env setup instructions. This may be a compatibility issue with pyenv?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions