question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

incompatible with werkzeug 2.2.0, can't import parse_rule

See original GitHub issue

Importing flask-login with werkzeug 2.2.0a1 ends up with:

Traceback:
/usr/lib64/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_packager_dashboard_pagure.py:4: in <module>
    from oraculum.utils import pagure
oraculum/__init__.py:29: in <module>
    from flask_login import LoginManager
/usr/lib/python3.11/site-packages/flask_login/__init__.py:12: in <module>
    from .login_manager import LoginManager
/usr/lib/python3.11/site-packages/flask_login/login_manager.py:35: in <module>
    from .utils import _create_identifier
/usr/lib/python3.11/site-packages/flask_login/utils.py:14: in <module>
    from werkzeug.routing import parse_rule
E   ImportError: cannot import name 'parse_rule' from 'werkzeug.routing' (/usr/lib/python3.11/site-packages/werkzeug/routing/__init__.py)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:15
  • Comments:11

github_iconTop GitHub Comments

2reactions
davidismcommented, Jul 11, 2022

I’m trying to figure out what that code does in the first place. I think it’s trying to say “if there’s a dynamic subdomain or host matching in the current rule, apply that same argument to the login rule.” But there’s surely a better way to go about that.

https://github.com/maxcountryman/flask-login/blob/62c04f482c3fb145c9f69054a799d4c55a9ef659/src/flask_login/utils.py#L95-L110

0reactions
davidismcommented, Jul 25, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name 'parse_rule' from 'werkzeug ...
The latest version of Flask requires Werkzeug >= 2.2.0 but Flask v2.1.2 requires Werkzeug >= 2.0 . Therefore Werkzeug was downgraded to v2.1.2...
Read more >
Changes — Werkzeug Documentation (2.2.x)
Update subpackage imports in werkzeug.routing to use the import as syntax for explicitly ... If parse_authorization_header can't decode the header value, ...
Read more >
Cannot import name 'parse_rule' from 'werkzeug.routing'
To solve the error, pin the werkzeug module to version 2.1.2 . importerror cannot import name parse rule from werkzeug routing. shell.
Read more >
8.5 Release Notes Red Hat Enterprise Linux 8
For more information on unsupported conversions, see How to perform an unsupported ... Improved the import and export of secure key objects in...
Read more >
Werkzeug Documentation (0.15.x) - Read the Docs
Werkzeug originally had a magical import system hook that enabled ... input stream is set you can't modify args and files unless you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found