Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fail to run for docker-curriculum #392

Open
zurialzurial opened this issue May 8, 2024 · 1 comment
Open

Docker build fail to run for docker-curriculum #392

zurialzurial opened this issue May 8, 2024 · 1 comment

Comments

@zurialzurial
Copy link

Hi Prakhar,

I am a newbie for Docker and I am really enjoying your website. Your website is very helpful for a beginner like me with theories and so practical as well.

However, I have a problem when running the docker-curriculum with the below error message.

docker run -p 8888:5000 xxxx/catnip
Traceback (most recent call last):
File "./app.py", line 1, in
from flask import Flask, render_template
File "/usr/local/lib/python3.8/site-packages/flask/init.py", line 7, in
from .app import Flask as Flask
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 28, in
from . import cli
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 18, in
from .helpers import get_debug_flag
File "/usr/local/lib/python3.8/site-packages/flask/helpers.py", line 16, in
from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.8/site-packages/werkzeug/urls.py)

I am not sure what is the issue, as I am just following your instruction.

I will be very appreciated if you can guide me.

thank you.

Regards,
Zurial

@todo
Copy link

todo commented May 19, 2024

The problem is caused by docker build system pull in the newer Werkzeug pkg (probably 3.x.x). In new werkzeug version there is no "url_encode'.

Just add the following line to your requirements.txt, then rebuild your image, it'll fix your problem

Werkzeug==2.2.2

thegreatfatzby added a commit to thegreatfatzby/docker-curriculum that referenced this issue May 27, 2024
Hey there, I had the same issue as @zurialzurial in prakhar1989#392, gonna suggest just adding this in, although I'll admit I don't know if this is the exact right thing to do more broadly (like if it could cause issues elsewhere).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants