dgzlopes / foobar-demo

Distributed tracing demo.
Apache License 2.0
29 stars 12 forks source link

Flask dependency issues - solved. #2

Open williamgrafana opened 2 years ago

williamgrafana commented 2 years ago

Looks like it there are dependency issues with the foo/bar flask app.

  File "/usr/local/bin/flask", line 5, in <module>
    from flask.cli import main
  File "/usr/local/lib/python3.10/site-packages/flask/__init__.py", line 19, in <module>
    from . import json
  File "/usr/local/lib/python3.10/site-packages/flask/json/__init__.py", line 15, in <module>
    from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.10/site-packages/itsdangerous/__init__.py)

Did a quick google search and found this

https://stackoverflow.com/questions/71189819/python-docker-importerror-cannot-import-name-json-from-itsdangerous

I modified the requirements.txt to below and everything start to work

opentelemetry-api
opentelemetry-sdk
opentelemetry-exporter-otlp
opentelemetry-instrumentation-flask
opentelemetry-instrumentation-requests
requests
Mkrummz commented 2 years ago

you also need Flask in the requirements.txt

this needs to be done at both paths: ./foobar-demo/services/foo/requirements.txt ./foobar-demo/services/bar/requirements.txt

requirements.txt: Flask opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp opentelemetry-instrumentation-flask opentelemetry-instrumentation-requests requests

dgzlopes commented 2 years ago

Hey! Thanks for reporting this.

Sadly, I'm not able to reproduce it on Ubuntu (20.04.3 LTS) nor on an M1 Macbook (12.2.1 Monterey)