docker ImportError: cannot import name '_plain_int' from 'werkzeug._internal' (/usr/lib/python3.9/site-packages/werkzeug/_internal.py) and seek advice
- Dominant language
- Python
- Stars
- 41.7k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
I was building the docker image trying to use the offline mode. But when the building was done, the docker showed me the log `ImportError: cannot import name '_plain_int' from 'werkzeug._internal' (/usr/lib/python3.9/site-packages/werkzeug/_internal.py)`
it turned out to be a version issue of werkzeug.
1. just add these lines to `requirements.txt`
```
protobuf
werkzeug==0.16.1
flask-wtf
```
2. run the command `docker build -t cheet .`
3. modify the line `image: cheat.sh` in the `docker-compose.yml` to ,in this case, `image: cheet`
it worked.
However, since curl cannot be used offline and the `localhost:8002` still shows me the hint that i'm using offline mode without Internet., so I'm wondering if there is a better way to use the docker version of the cheat.sh offline.
Contributor guide
Research direction
Start with requirements.txt and docker-compose.yml, then reproduce the image with docker build -t cheet . and inspect the localhost:8002 behavior in offline mode. Check the pinned Werkzeug dependency and the Docker offline path; done means the image builds without the ImportError and the offline service behaves as intended without Internet access.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, flask, python
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100