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