dgzlopes / foobar-demo

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

ImportError: cannot import name 'escape' from 'jinja2' #7

Closed danstadler-pdx closed 1 year ago

danstadler-pdx commented 2 years ago

Cloned repo, running on MacBook Pro. Docker-compose up succeeds, but then the foo and bar containers exit.

Here are logs from foobar-demo_foo_1:

Traceback (most recent call last): File "/usr/local/bin/flask", line 5, in from flask.cli import main File "/usr/local/lib/python3.11/site-packages/flask/init.py", line 14, in from jinja2 import escape ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.11/site-packages/jinja2/init.py) Traceback (most recent call last): File "/usr/local/bin/flask", line 5, in from flask.cli import main File "/usr/local/lib/python3.11/site-packages/flask/init.py", line 14, in from jinja2 import escape ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.11/site-packages/jinja2/init.py)

logs from bar:

Traceback (most recent call last): File "/usr/local/bin/flask", line 5, in from flask.cli import main File "/usr/local/lib/python3.11/site-packages/flask/init.py", line 14, in from jinja2 import escape ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.11/site-packages/jinja2/init.py)

danstadler-pdx commented 2 years ago

trying to upgrade flask to latest (2.2.2):

#8 2.264 ERROR: Cannot install -r requirements.txt (line 5) and Flask==2.2.2 because these package versions have conflicting dependencies.
#8 2.264
#8 2.264 The conflict is caused by:
#8 2.264     The user requested Flask==2.2.2
#8 2.264     opentelemetry-instrumentation-flask 0.19b0 depends on flask~=1.0
#8 2.264
#8 2.264 To fix this you could try to:
#8 2.264 1. loosen the range of package versions you've specified
#8 2.264 2. remove package versions to allow pip attempt to solve the dependency conflict
#8 2.264
#8 2.264 ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
------
executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1
ERROR: Service 'foo' failed to build : Build failed
danstadler-pdx commented 2 years ago

I have "bar" running with the following in requirements.txt; will build foo next and then try to continue the SE onboarding exercise around this.

Flask==2.2.2 opentelemetry-api==1.13.0 opentelemetry-sdk==1.13.0 opentelemetry-exporter-otlp==1.13.0 opentelemetry-instrumentation-flask==0.34b0 opentelemetry-instrumentation-requests==0.34b0 requests==2.22.0

danstadler-pdx commented 2 years ago

that fixed it for both services. I can file a PR if that helps.

dgzlopes commented 1 year ago

Please, do! @danstadler-pdx 🙇‍♂️