Share via

Getting AttributeError: type object 'SpanAttributes' has no attribute 'LLM_SYSTEM'

Leena Naik 25 Reputation points
2026-02-22T23:39:24.2833333+00:00

Getting above error https://microsoftlearning.github.io/mslearn-ai-agents/Instructions/Exercises/07-agent-framework.html

with Python 3.11.9

This question is related to the following Learning Path

Azure
Azure

A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. 秀行 佐々木 0 Reputation points
    2026-02-24T10:11:39.3733333+00:00

    Pinning it to

    opentelemetry-semantic-conventions-ai==0.4.13

    worked around this issue.

    See https://github.com/microsoft/agent-framework/issues/4160

    0 comments No comments

  2. Marcin Policht 81,395 Reputation points MVP Volunteer Moderator
    2026-02-22T23:56:46.8733333+00:00

    This might be caused by a version mismatch between the Microsoft Agent Framework SDK and the OpenTelemetry packages installed from requirements.txt.

    If that's the case, downgrade OpenTelemetry to a compatible version.

    In your Labfiles/07-agent-framework/Python folder, run:

    pip uninstall opentelemetry-api opentelemetry-sdk -y
    pip install opentelemetry-api==1.27.0 opentelemetry-sdk==1.27.0
    

    If that does not resolve it, install the slightly older, known-working set:

    pip uninstall opentelemetry-api opentelemetry-sdk opentelemetry-semantic-conventions -y
    pip install opentelemetry-api==1.24.0 opentelemetry-sdk==1.24.0 opentelemetry-semantic-conventions==0.45b0
    

    Then run:

    python agent-framework.py
    

    If you still get dependency conflicts, create a clean virtual environment and reinstall everything:

    python -m venv .venv
    .\.venv\Scripts\activate
    pip install -r requirements.txt
    pip uninstall opentelemetry-api opentelemetry-sdk opentelemetry-semantic-conventions -y
    pip install opentelemetry-api==1.24.0 opentelemetry-sdk==1.24.0 opentelemetry-semantic-conventions==0.45b0
    

    If this doesn't yield a resolution, post an issue in the corresponding GitHub repo https://github.com/MicrosoftLearning/mslearn-ai-agents/issues


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.