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

script fails to run due to dependancy version incompatibility with flask #2

Open
MajedAlghoul opened this issue Oct 2, 2024 · 0 comments

Comments

@MajedAlghoul
Copy link

Description

the script fails to launch due to werkzeug version incompatibility with flask.

How to reproduce

  1. run requirements.txt without having werkzeug already installed
  2. run main.py

Error Details

Traceback (most recent call last):
  File "pdf-to-audiobook-converter\main.py", line 4, in <module>
    from flask import Flask, render_template, send_file
  File "Python\Python312\Lib\site-packages\flask\__init__.py", line 5, in <module>
    from .app import Flask as Flask
  File "Python\Python312\Lib\site-packages\flask\app.py", line 30, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (Python\Python312\Lib\site-packages\werkzeug\urls.py). Did you mean: 'unquote'?

Explaination and Solution

the issue is most likely that since the version of werkzeug is not specified in the requierments.txt file, the latest version gets installed which is not compatible with flask, at least version 2.2.3.

a possible solution is adding this line to the requierments.txt file:

Werkzeug==2.2.2

for more details, check this stack overflow question.

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

1 participant